Ticket #19257: 19257.patch
File 19257.patch, 7.7 KB (added by , 13 years ago) |
---|
-
wp-admin/edit-form-advanced.php
122 122 add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); 123 123 124 124 if ( current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) ) 125 add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');125 add_meta_box('postimagediv', $post_type_object->labels->featured_image, 'post_thumbnail_meta_box', null, 'side', 'low'); 126 126 127 127 if ( post_type_supports($post_type, 'excerpt') ) 128 128 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core'); -
wp-admin/includes/media.php
1162 1162 $calling_post_id = $post->post_parent; 1163 1163 if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) 1164 1164 && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) { 1165 $calling_post = get_post( $calling_post_id ); 1166 $calling_post_type_object = get_post_type_object( $calling_post->post_type ); 1165 1167 $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" ); 1166 $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html __( "Use as featured image") . "</a>";1168 $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html( $calling_post_type_object->labels->use_featured_image ) . "</a>"; 1167 1169 } 1168 1170 1169 1171 if ( ( $send || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) … … 1247 1249 * @since 2.5.0 1248 1250 */ 1249 1251 function media_upload_header() { 1252 $post_id = intval($_REQUEST['post_id']); 1253 if ( !empty( $post_id ) ) 1254 $post_type = get_post_type( $post_id ); 1255 else 1256 $post_type = ''; 1250 1257 ?> 1251 <script type="text/javascript">post_id = <?php echo intval($_REQUEST['post_id']); ?>;</script>1258 <script type="text/javascript">post_id = <?php echo $post_id; ?>;post_type = '<?php echo $post_type; ?>';</script> 1252 1259 <div id="media-upload-header"> 1253 1260 <?php the_media_upload_tabs(); ?> 1254 1261 </div> -
wp-admin/includes/post.php
1144 1144 */ 1145 1145 function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { 1146 1146 global $content_width, $_wp_additional_image_sizes, $post_ID; 1147 $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image') ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>'; 1148 $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' )); 1147 $post = get_post( $post_ID ); 1148 $post_type_object = get_post_type_object( $post->post_type ); 1149 $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr( $post_type_object->labels->set_featured_image ) . '" href="' . esc_url( get_upload_iframe_src('image') ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>'; 1150 $content = sprintf($set_thumbnail_link, esc_html( $post_type_object->labels->set_featured_image )); 1149 1151 1150 1152 if ( $thumbnail_id && get_post( $thumbnail_id ) ) { 1151 1153 $old_content_width = $content_width; … … 1157 1159 if ( !empty( $thumbnail_html ) ) { 1158 1160 $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$post_ID" ); 1159 1161 $content = sprintf($set_thumbnail_link, $thumbnail_html); 1160 $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html __( 'Remove featured image') . '</a></p>';1162 $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>'; 1161 1163 } 1162 1164 $content_width = $old_content_width; 1163 1165 } -
wp-admin/js/set-post-thumbnail.dev.js
6 6 action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie) 7 7 }, function(str){ 8 8 var win = window.dialogArguments || opener || parent || top; 9 $link.text( setPostThumbnailL10n.setThumbnail ); 9 setThumbnail = 'setThumbnail_' + post_type; 10 $link.text( setPostThumbnailL10n[setThumbnail] ); 10 11 if ( str == '0' ) { 11 12 alert( setPostThumbnailL10n.error ); 12 13 } else { -
wp-includes/post.php
1192 1192 'not_found' => array( __('No posts found.'), __('No pages found.') ), 1193 1193 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), 1194 1194 'parent_item_colon' => array( null, __('Parent Page:') ), 1195 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ) 1195 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), 1196 'featured_image' => array( __( 'Featured Image' ), __( 'Featured Image' ) ), 1197 'set_featured_image' => array( __( 'Set featured image' ), __( 'Set featured image' ) ), 1198 'remove_featured_image' => array( __( 'Remove featured image' ), __( 'Remove featured image' ) ), 1199 'use_featured_image' => array( __( 'Use as featured image' ), __( 'Use as featured image' ) ) 1196 1200 ); 1197 1201 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1198 1202 return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults ); -
wp-includes/script-loader.php
379 379 'error' => __( 'Could not load the preview image. Please reload the page and try again.' ) 380 380 )); 381 381 382 $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20100518', 1 ); 383 $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( 384 'setThumbnail' => __( 'Use as featured image' ), 382 $setPostThumbnailL10n = array( 383 'setThumbnail' => __( 'Use as featured image' ), // Back compat 385 384 'saving' => __( 'Saving...' ), 386 385 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ), 387 386 'done' => __( 'Done' ) 388 ) );387 ); 389 388 389 foreach ( get_post_types( null, 'objects' ) as $post_type_object ) { 390 if ( isset( $post_type_object->labels->use_featured_image ) ) 391 $setPostThumbnailL10n["setThumbnail_{$post_type_object->name}"] = $post_type_object->labels->use_featured_image; 392 } 393 394 $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20100518', 1 ); 395 $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', $setPostThumbnailL10n ); 396 390 397 // Navigation Menus 391 398 $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array('jquery-ui-sortable'), '20111115' ); 392 399 $scripts->localize( 'nav-menu', 'navMenuL10n', array(