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

git-svn-id: https://develop.svn.wordpress.org/trunk@23086 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-12-06 03:28:21 +00:00
parent 977deb7d63
commit f82ed67255

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";
} }