Ticket #21391: 21391.4.diff
File 21391.4.diff, 6.1 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/meta-boxes.php
302 302 * 303 303 * @param object $post 304 304 */ 305 function attachment_data_meta_box( $post ) { 306 $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); 305 function attachment_content_meta_box( $post ) { 307 306 $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ); 308 307 $editor_args = array( 309 308 'textarea_name' => 'content', … … 317 316 <label class="screen-reader-text" for="content"><strong><?php _e( 'Attachment Page Content' ); ?></strong></label> 318 317 <?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?> 319 318 </p> 320 321 <p>322 <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br />323 <textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea>324 </p>325 <p>326 <label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br />327 <input type="text" class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" value="<?php echo esc_attr( $alt_text ); ?>" />328 </p>329 319 <?php 330 320 } 331 321 332 322 /** 323 * Displays non-editable attachment metadata 324 * 325 * @since 3.5.0 326 */ 327 function attachment_metadata_meta_box() { 328 $post = get_post(); 329 330 $attachment_id = intval( $post->ID ); 331 $filename = esc_html( basename( $post->guid ) ); 332 $title = esc_attr( $post->post_title ); 333 334 $post_mime_types = get_post_mime_types(); 335 $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) ); 336 $type = array_shift( $keys ); 337 $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />"; 338 339 $media_dims = ''; 340 $meta = wp_get_attachment_metadata( $post->ID ); 341 if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) ) 342 $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> "; 343 $media_dims = apply_filters( 'media_meta', $media_dims, $post ); 344 345 $att_url = wp_get_attachment_url( $post->ID ); 346 347 $output = ' 348 <div class="wp_attachment_details"> 349 <p> 350 <label for="attachment_url"><strong>' . __( 'File URL' ) . '</strong></label><br /> 351 <input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" value="' . esc_attr($att_url) . '" /><br /> 352 </p> 353 <p><strong>' . __( 'File name:' ) . '</strong> ' . $filename . '<br /> 354 <strong>' . __( 'File type:' ) . '</strong> ' . $post->post_mime_type; 355 356 if ( $media_dims ) 357 $output .= '<br /><strong>' . __( 'Dimensions:' ) . '</strong> ' . $media_dims; 358 359 $output .= ' 360 </p> 361 </div>'; 362 363 $output = apply_filters( 'edit_form_attachment_metadata', $output, $post ); 364 365 echo $output; 366 } 367 368 /** 333 369 * Display post format form elements. 334 370 * 335 371 * @since 3.1.0 -
wp-admin/includes/media.php
2122 2122 2123 2123 $filename = esc_html( basename( $post->guid ) ); 2124 2124 $title = esc_attr( $post->post_title ); 2125 $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); 2125 2126 2126 2127 $post_mime_types = get_post_mime_types(); 2127 2128 $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) ); … … 2151 2152 <p><?php echo $image_edit_button; ?></p> 2152 2153 </div> 2153 2154 <div style="display:none" class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"></div> 2155 </div> 2154 2156 2155 <div class="wp_attachment_details"> 2156 <p> 2157 <label for="attachment_url"><strong><?php _e( 'File URL' ); ?></strong></label><br /> 2158 <input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" value="<?php echo esc_attr($att_url); ?>" /><br /> 2159 </p> 2160 <p><strong><?php _e( 'File name:' ); ?></strong> <?php echo $filename; ?><br /> 2161 <strong><?php _e( 'File type:' ); ?></strong> <?php echo $post->post_mime_type; ?> 2162 <?php 2163 if ( $media_dims ) 2164 echo '<br /><strong>' . __( 'Dimensions:' ) . '</strong> ' . $media_dims; 2165 ?> 2166 </p> 2167 </div> 2157 <div class="wp_attachment_details"> 2158 <p> 2159 <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br /> 2160 <textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea> 2161 </p> 2162 <p> 2163 <label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br /> 2164 <input type="text" class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" value="<?php echo esc_attr( $alt_text ); ?>" /> 2165 </p> 2168 2166 </div> 2169 2167 <?php 2168 // need a filter on this content 2170 2169 } 2171 2170 2172 2171 add_filter( 'async_upload_image', 'get_media_item', 10, 2 ); -
wp-admin/edit-form-advanced.php
111 111 wp_enqueue_script( 'image-edit' ); 112 112 wp_enqueue_style( 'imgareaselect' ); 113 113 add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' ); 114 add_meta_box( 'attachmentdata', __('Attachment Page Content'), 'attachment_data_meta_box', null, 'normal', 'core' ); 114 add_meta_box( 'attachmentmeta', __('Meta Data'), 'attachment_metadata_meta_box', null, 'side', 'core' ); 115 add_meta_box( 'attachmentdata', __('Attachment Page Content'), 'attachment_content_meta_box', null, 'normal', 'core' ); 115 116 add_action( 'edit_form_after_title', 'edit_form_image_editor' ); 116 117 } else { 117 118 add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core' ); -
wp-admin/css/wp-admin.css
5826 5826 padding: 0; 5827 5827 } 5828 5828 5829 #post stuff .postarea{5829 #post-body-content { 5830 5830 margin-bottom: 20px; 5831 5831 } 5832 5832