Changeset 22364
- Timestamp:
- 11/05/2012 02:04:22 PM (12 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin.css
r22329 r22364 5827 5827 } 5828 5828 5829 #post stuff .postarea{5829 #post-body-content { 5830 5830 margin-bottom: 20px; 5831 5831 } -
trunk/wp-admin/edit-form-advanced.php
r22291 r22364 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( 'attachmentdata', __('Attachment Page Content'), 'attachment_content_meta_box', null, 'normal', 'core' ); 115 115 add_action( 'edit_form_after_title', 'edit_form_image_editor' ); 116 116 } else { -
trunk/wp-admin/includes/media.php
r22105 r22364 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(); … … 2152 2153 </div> 2153 2154 <div style="display:none" class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"></div> 2154 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> 2155 </div> 2156 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 2169 } 2170 2171 /** 2172 * Displays non-editable attachment metadata in the publish metabox 2173 * 2174 * @since 3.5.0 2175 */ 2176 function attachment_submitbox_metadata() { 2177 $post = get_post(); 2178 2179 $filename = esc_html( basename( $post->guid ) ); 2180 2181 $media_dims = ''; 2182 $meta = wp_get_attachment_metadata( $post->ID ); 2183 if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) ) 2184 $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> "; 2185 $media_dims = apply_filters( 'media_meta', $media_dims, $post ); 2186 2187 $att_url = wp_get_attachment_url( $post->ID ); 2188 ?> 2189 <div class="misc-pub-section"> 2190 <label for="attachment_url"><?php _e( 'File URL:' ); ?></label> 2191 <input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" value="<?php echo esc_attr($att_url); ?>" /> 2192 </div> 2193 <div class="misc-pub-section"> 2194 <?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong> 2195 </div> 2196 <div class="misc-pub-section"> 2197 <?php _e( 'File type:' ); ?> <strong><?php echo $post->post_mime_type; ?></strong> 2198 </div> 2199 2200 <?php if ( $media_dims ) : ?> 2201 <div class="misc-pub-section"> 2202 <?php _e( 'Dimensions:' ); ?> <strong><?php echo $media_dims; ?></strong> 2203 </div> 2204 <?php 2205 endif; 2170 2206 } 2171 2207 … … 2182 2218 add_filter( 'media_upload_gallery', 'media_upload_gallery' ); 2183 2219 add_filter( 'media_upload_library', 'media_upload_library' ); 2220 2221 add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' ); -
trunk/wp-admin/includes/meta-boxes.php
r22321 r22364 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( … … 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 </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 318 </p> 329 319 <?php
Note: See TracChangeset
for help on using the changeset viewer.