Add hidden fields via attachment_fields_to_edit to the existing compat output. props nacin. fixes #22769.

git-svn-id: http://core.svn.wordpress.org/trunk@23086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-12-06 03:28:21 +00:00
parent c75dc67668
commit 8efc323e2e
1 changed files with 4 additions and 4 deletions

View File

@ -1413,9 +1413,12 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
if ( $item ) if ( $item )
$item = '<table class="compat-attachment-fields">' . $item . '</table>'; $item = '<table class="compat-attachment-fields">' . $item . '</table>';
foreach ( $hidden_fields as $hidden_field => $value ) {
$item .= '<input type="hidden" name="' . esc_attr( $hidden_field ) . '" value="' . esc_attr( $value ) . '" />' . "\n";
}
return array( return array(
'item' => $item, 'item' => $item,
'hidden' => $hidden_fields,
'meta' => $media_meta, 'meta' => $media_meta,
); );
} }
@ -2332,9 +2335,6 @@ function edit_form_image_editor() {
<?php <?php
$extras = get_compat_media_markup( $post->ID ); $extras = get_compat_media_markup( $post->ID );
echo $extras['item']; echo $extras['item'];
foreach ( $extras['hidden'] as $hidden_field => $value ) {
echo '<input type="hidden" name="' . esc_attr( $hidden_field ) . '" value="' . esc_attr( $value ) . '" />' . "\n";
}
echo '<input type="hidden" id="image-edit-context" value="edit-attachment" />' . "\n"; echo '<input type="hidden" id="image-edit-context" value="edit-attachment" />' . "\n";
} }