Ticket #22759: 22759.6.diff
File 22759.6.diff, 11.7 KB (added by , 12 years ago) |
---|
-
wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
73 73 </td> 74 74 </tr> 75 75 76 <tr id="cap_field">76 <tr> 77 77 <th valign="top" scope="row" class="label"> 78 <label for="img_ cap">79 <span class="alignleft">{#wpeditimage. caption}</span>78 <label for="img_title"> 79 <span class="alignleft">{#wpeditimage.img_title}</span> 80 80 </label> 81 81 </th> 82 82 <td class="field"> 83 < textarea id="img_cap_text"></textarea>83 <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" /> 84 84 </td> 85 85 </tr> 86 86 … … 95 95 </td> 96 96 </tr> 97 97 98 <tr id="cap_field"> 99 <th valign="top" scope="row" class="label"> 100 <label for="img_cap"> 101 <span class="alignleft">{#wpeditimage.caption}</span> 102 </label> 103 </th> 104 <td class="field"> 105 <textarea id="img_cap_text"></textarea> 106 </td> 107 </tr> 108 98 109 <tr> 99 110 <th valign="top" scope="row" class="label"> 100 111 <label for="link_href"> … … 147 158 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> 163 163 </label> -
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
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 } … … 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'] ); … … 1923 1926 if ( 'attachment' != $post['post_type'] ) 1924 1927 wp_send_json_error(); 1925 1928 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 1930 1929 $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data ); 1931 1930 1932 1931 if ( isset( $post['errors'] ) ) { -
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
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'] ) … … 1329 1328 $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post ); 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 1347 1345 $hidden_fields = array(); … … 1361 1359 1362 1360 $field = array_merge( $defaults, $field ); 1363 1361 1362 if ( ( ! $field['show_in_edit'] && ! $args['in_modal'] ) || ( ! $field['show_in_modal'] && $args['in_modal'] ) ) 1363 continue; 1364 1364 1365 if ( $field['input'] == 'hidden' ) { 1365 1366 $hidden_fields[$name] = $field['value']; 1366 1367 continue; … … 2282 2283 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"> 2293 2294 <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div> … … 2298 2299 </div> 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"> 2303 2305 <p> … … 2312 2314 </p> 2313 2315 <?php endif; ?> 2314 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 ); ?> 2330 2315 2331 </div> 2316 2332 <?php 2317 2333 $extras = get_compat_media_markup( $post->ID ); … … 2348 2364 <?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong> 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 2354 2375 <?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' ); -
wp-admin/css/wp-admin.css
3407 3407 display: none; 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; 3412 3416 padding-right: 10px; … … 4391 4395 padding: 2px 10px; 4392 4396 } 4393 4397 4398 .wp_attachment_details { 4399 margin-bottom: 20px; 4400 } 4401 4394 4402 /*------------------------------------------------------------------------------ 4395 4403 15.0 - Comments Screen 4396 4404 ------------------------------------------------------------------------------*/