Ticket #22759: 22759.3.diff
File 22759.3.diff, 7.6 KB (added by , 12 years ago) |
---|
-
wp-includes/js/media-editor.js
554 554 props = wp.media.string.props( props, attachment ); 555 555 556 556 options = { 557 id: attachment.id 557 id: attachment.id, 558 post_content: attachment.description 558 559 }; 559 560 560 561 if ( props.linkUrl ) -
wp-includes/js/media-views.js
2829 2829 width: '', 2830 2830 height: '', 2831 2831 compat: false, 2832 alt: '' 2832 alt: '', 2833 description: '', 2833 2834 }); 2834 2835 2835 2836 options.buttons = this.buttons; -
wp-includes/media.php
1740 1740 <label class="setting" data-setting="title"> 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 1754 1761 <script type="text/html" id="tmpl-media-selection"> -
wp-admin/includes/ajax-actions.php
1884 1884 if ( isset( $changes['caption'] ) ) 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 ); 1889 1892 $new_alt = stripslashes( $changes['alt'] ); -
wp-admin/includes/meta-boxes.php
296 296 } 297 297 298 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 <?php320 }321 322 /**323 299 * Display post format form elements. 324 300 * 325 301 * @since 3.1.0 -
wp-admin/includes/media.php
1329 1329 $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post ); 1330 1330 1331 1331 unset( $form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'], 1332 $form_fields['post_title'], $form_fields['post_excerpt'], 1332 $form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'], 1333 1333 $form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] ); 1334 1334 1335 if ( ! $args['description'] )1336 unset( $form_fields['post_content'] );1337 1338 1335 $media_meta = apply_filters( 'media_meta', '', $post ); 1339 1336 1340 1337 $defaults = array( … … 2282 2279 2283 2280 $att_url = wp_get_attachment_url( $post->ID ); 2284 2281 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 2282 if ( wp_attachment_is_image( $post->ID ) ) : 2283 $image_edit_button = ''; 2284 if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { 2285 $nonce = wp_create_nonce( "image_editor-$post->ID" ); 2286 $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>"; 2287 } 2291 2288 ?> 2292 2289 <div class="wp_attachment_holder"> 2293 2290 <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div> … … 2298 2295 </div> 2299 2296 <div style="display:none" class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"></div> 2300 2297 </div> 2298 <?php endif; ?> 2301 2299 2302 2300 <div class="wp_attachment_details"> 2303 2301 <p> … … 2312 2310 </p> 2313 2311 <?php endif; ?> 2314 2312 2313 <?php 2314 $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ); 2315 $editor_args = array( 2316 'textarea_name' => 'content', 2317 'textarea_rows' => 5, 2318 'media_buttons' => false, 2319 'tinymce' => false, 2320 'quicktags' => $quicktags_settings, 2321 ); 2322 ?> 2323 <p> 2324 <label for="content"><strong><?php _e( 'Description' ); ?></strong></label> 2325 <?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?> 2326 </p> 2327 2315 2328 </div> 2316 2329 <?php 2317 2330 $extras = get_compat_media_markup( $post->ID ); … … 2348 2361 <?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong> 2349 2362 </div> 2350 2363 <div class="misc-pub-section"> 2351 <?php _e( 'File type:' ); ?> <strong><?php echo $post->post_mime_type; ?></strong> 2364 <?php _e( 'File type:' ); ?> <strong><?php 2365 if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) 2366 echo esc_html( strtoupper( $matches[1] ) ); 2367 else 2368 echo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) ); 2369 ?> 2352 2370 </div> 2353 2371 2354 2372 <?php if ( $media_dims ) : ?> -
wp-admin/edit-form-advanced.php
107 107 wp_enqueue_script( 'image-edit' ); 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 { 113 112 add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core' );