Changeset 23083 for trunk/wp-admin/includes/media.php
- Timestamp:
- 12/06/2012 12:41:06 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r23072 r23083 1287 1287 $default_args = array( 1288 1288 'errors' => null, 1289 'taxonomies' => false, 1290 'description' => false, 1289 'in_modal' => false, 1291 1290 ); 1292 1291 … … 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); … … 1330 1329 1331 1330 unset( $form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'], 1332 $form_fields['post_title'], $form_fields['post_excerpt'], 1331 $form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'], 1333 1332 $form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] ); 1334 1333 1335 if ( ! $args['description'] )1336 unset( $form_fields['post_content'] );1337 1338 1334 $media_meta = apply_filters( 'media_meta', '', $post ); 1339 1335 1340 1336 $defaults = array( 1341 'input' => 'text', 1342 'required' => false, 1343 'value' => '', 1344 'extra_rows' => array(), 1337 'input' => 'text', 1338 'required' => false, 1339 'value' => '', 1340 'extra_rows' => array(), 1341 'show_in_edit' => true, 1342 'show_in_modal' => true, 1345 1343 ); 1346 1344 … … 1361 1359 1362 1360 $field = array_merge( $defaults, $field ); 1361 1362 if ( ( ! $field['show_in_edit'] && ! $args['in_modal'] ) || ( ! $field['show_in_modal'] && $args['in_modal'] ) ) 1363 continue; 1363 1364 1364 1365 if ( $field['input'] == 'hidden' ) { … … 2283 2284 $att_url = wp_get_attachment_url( $post->ID ); 2284 2285 2285 $image_edit_button = '';2286 if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {2287 $nonce = wp_create_nonce( "image_editor-$post->ID" );2288 $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";2289 }2290 2286 if ( wp_attachment_is_image( $post->ID ) ) : 2287 $image_edit_button = ''; 2288 if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { 2289 $nonce = wp_create_nonce( "image_editor-$post->ID" ); 2290 $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>"; 2291 } 2291 2292 ?> 2292 2293 <div class="wp_attachment_holder"> … … 2299 2300 <div style="display:none" class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"></div> 2300 2301 </div> 2302 <?php endif; ?> 2301 2303 2302 2304 <div class="wp_attachment_details"> … … 2312 2314 </p> 2313 2315 <?php endif; ?> 2316 2317 <?php 2318 $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ); 2319 $editor_args = array( 2320 'textarea_name' => 'content', 2321 'textarea_rows' => 5, 2322 'media_buttons' => false, 2323 'tinymce' => false, 2324 'quicktags' => $quicktags_settings, 2325 ); 2326 ?> 2327 2328 <label for="content"><strong><?php _e( 'Description' ); ?></strong></label> 2329 <?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?> 2314 2330 2315 2331 </div> … … 2349 2365 </div> 2350 2366 <div class="misc-pub-section"> 2351 <?php _e( 'File type:' ); ?> <strong><?php echo $post->post_mime_type; ?></strong> 2367 <?php _e( 'File type:' ); ?> <strong><?php 2368 if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) 2369 echo esc_html( strtoupper( $matches[1] ) ); 2370 else 2371 echo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) ); 2372 ?></strong> 2352 2373 </div> 2353 2374
Note: See TracChangeset
for help on using the changeset viewer.