Changeset 23083
- Timestamp:
- 12/06/2012 12:41:06 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin.css
r23004 r23083 3408 3408 } 3409 3409 3410 #post-body-content .compat-attachment-fields { 3411 margin-bottom: 20px; 3412 } 3413 3410 3414 .compat-attachment-fields th { 3411 3415 padding-top: 5px; … … 4390 4394 margin-bottom: 8px; 4391 4395 padding: 2px 10px; 4396 } 4397 4398 .wp_attachment_details { 4399 margin-bottom: 20px; 4392 4400 } 4393 4401 -
trunk/wp-admin/edit-form-advanced.php
r22963 r23083 108 108 wp_enqueue_style( 'imgareaselect' ); 109 109 add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' ); 110 add_meta_box( 'attachmentdata', __('Attachment Page Content'), 'attachment_content_meta_box', null, 'normal', 'core' );111 110 add_action( 'edit_form_after_title', 'edit_form_image_editor' ); 112 111 } else { -
trunk/wp-admin/includes/ajax-actions.php
r23058 r23083 1885 1885 $post['post_excerpt'] = $changes['caption']; 1886 1886 1887 if ( isset( $changes['description'] ) ) 1888 $post['post_content'] = $changes['description']; 1889 1887 1890 if ( isset( $changes['alt'] ) ) { 1888 1891 $alt = get_post_meta( $id, '_wp_attachment_image_alt', true ); … … 1923 1926 if ( 'attachment' != $post['post_type'] ) 1924 1927 wp_send_json_error(); 1925 1926 // Handle the description field automatically, if a plugin adds it back.1927 if ( isset( $attachment_data['post_content'] ) )1928 $post['post_content'] = $attachment_data['post_content'];1929 1928 1930 1929 $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data ); -
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 -
trunk/wp-admin/includes/meta-boxes.php
r23044 r23083 293 293 </div> 294 294 295 <?php296 }297 298 /**299 * Display attachment/media-specific information300 *301 * @since 3.5.0302 *303 * @param object $post304 */305 function attachment_content_meta_box( $post ) {306 $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );307 $editor_args = array(308 'textarea_name' => 'content',309 'textarea_rows' => 5,310 'media_buttons' => false,311 'tinymce' => false,312 'quicktags' => $quicktags_settings,313 );314 ?>315 <p>316 <label class="screen-reader-text" for="content"><strong><?php _e( 'Attachment Page Content' ); ?></strong></label>317 <?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?>318 </p>319 295 <?php 320 296 } -
trunk/wp-includes/js/media-editor.js
r23069 r23083 555 555 556 556 options = { 557 id: attachment.id 557 id: attachment.id, 558 post_content: attachment.description 558 559 }; 559 560 -
trunk/wp-includes/js/media-views.js
r23076 r23083 2830 2830 height: '', 2831 2831 compat: false, 2832 alt: '' 2832 alt: '', 2833 description: '', 2833 2834 }); 2834 2835 -
trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
r22948 r23083 74 74 </tr> 75 75 76 <tr> 77 <th valign="top" scope="row" class="label"> 78 <label for="img_title"> 79 <span class="alignleft">{#wpeditimage.img_title}</span> 80 </label> 81 </th> 82 <td class="field"> 83 <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" /> 84 </td> 85 </tr> 86 87 <tr> 88 <th valign="top" scope="row" class="label"> 89 <label for="img_alt"> 90 <span class="alignleft">{#wpeditimage.alt}</span> 91 </label> 92 </th> 93 <td class="field"> 94 <input type="text" id="img_alt" name="img_alt" value="" size="60" /> 95 </td> 96 </tr> 97 76 98 <tr id="cap_field"> 77 99 <th valign="top" scope="row" class="label"> … … 82 104 <td class="field"> 83 105 <textarea id="img_cap_text"></textarea> 84 </td>85 </tr>86 87 <tr>88 <th valign="top" scope="row" class="label">89 <label for="img_alt">90 <span class="alignleft">{#wpeditimage.alt}</span>91 </label>92 </th>93 <td class="field">94 <input type="text" id="img_alt" name="img_alt" value="" size="60" />95 106 </td> 96 107 </tr> … … 148 159 <tr> 149 160 <th valign="top" scope="row" class="label"> 150 <label for="img_title">151 <span class="alignleft">{#wpeditimage.img_title}</span>152 </label>153 </th>154 <td class="field">155 <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" />156 </td>157 </tr>158 159 <tr>160 <th valign="top" scope="row" class="label">161 161 <label for="img_classes"> 162 162 <span class="alignleft">{#wpeditimage.css}</span> -
trunk/wp-includes/media.php
r23076 r23083 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 ); … … 1741 1741 <span><?php _e('Title'); ?></span> 1742 1742 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} 1743 <# if ( 'video' === data.type ) { #> 1744 placeholder="<?php esc_attr_e('Describe this video…'); ?>" 1745 <# } else if ( 'audio' === data.type ) { #> 1746 placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" 1747 <# } else { #> 1748 placeholder="<?php esc_attr_e('Describe this media file…'); ?>" 1749 <# } #>/> 1743 <# if ( ! maybeReadOnly ) { #> 1744 <# if ( 'video' === data.type ) { #> 1745 placeholder="<?php esc_attr_e('Describe this video…'); ?>" 1746 <# } else if ( 'audio' === data.type ) { #> 1747 placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" 1748 <# } else { #> 1749 placeholder="<?php esc_attr_e('Describe this media file…'); ?>" 1750 <# } #> 1751 <# } #> 1752 /> 1750 1753 </label> 1751 1754 <# } #> 1755 <label class="setting" data-setting="description"> 1756 <span><?php _e('Description'); ?></span> 1757 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 1758 </label> 1752 1759 </script> 1753 1760
Note: See TracChangeset
for help on using the changeset viewer.