Ticket #22759: 22759.2.diff
File 22759.2.diff, 2.2 KB (added by , 12 years ago) |
---|
-
wp-includes/media.php
1395 1395 } 1396 1396 1397 1397 if ( function_exists('get_compat_media_markup') ) 1398 $response['compat'] = get_compat_media_markup( $attachment->ID, array( ' taxonomies' => true, 'description' => true ) );1398 $response['compat'] = get_compat_media_markup( $attachment->ID, array( 'in_modal' => true ) ); 1399 1399 1400 1400 return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta ); 1401 1401 } -
wp-admin/includes/media.php
1286 1286 1287 1287 $default_args = array( 1288 1288 'errors' => null, 1289 'taxonomies' => false, 1290 'description' => false, 1289 'in_modal' => false, 1291 1290 ); 1292 1291 1293 1292 $user_can_edit = current_user_can( 'edit_post', $attachment_id ); … … 1297 1296 1298 1297 $form_fields = array(); 1299 1298 1300 if ( $args[' taxonomies'] ) {1299 if ( $args['in_modal'] ) { 1301 1300 foreach ( get_attachment_taxonomies($post) as $taxonomy ) { 1302 1301 $t = (array) get_taxonomy($taxonomy); 1303 1302 if ( ! $t['public'] || ! $t['show_ui'] ) … … 1332 1331 $form_fields['post_title'], $form_fields['post_excerpt'], 1333 1332 $form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] ); 1334 1333 1335 if ( ! $args[' description'] )1334 if ( ! $args['in_modal'] ) 1336 1335 unset( $form_fields['post_content'] ); 1337 1336 1338 1337 $media_meta = apply_filters( 'media_meta', '', $post ); 1339 1338 1340 1339 $defaults = array( 1341 'input' => 'text', 1342 'required' => false, 1343 'value' => '', 1344 'extra_rows' => array(), 1340 'input' => 'text', 1341 'required' => false, 1342 'value' => '', 1343 'extra_rows' => array(), 1344 'show_in_edit' => true, 1345 'show_in_modal' => true, 1345 1346 ); 1346 1347 1347 1348 $hidden_fields = array(); … … 1361 1362 1362 1363 $field = array_merge( $defaults, $field ); 1363 1364 1365 if ( ( ! $field['show_in_edit'] && ! $args['in_modal'] ) || ( ! $field['show_in_modal'] && $args['in_modal'] ) ) 1366 continue; 1367 1364 1368 if ( $field['input'] == 'hidden' ) { 1365 1369 $hidden_fields[$name] = $field['value']; 1366 1370 continue;