Ticket #19257: 19257-2.patch
File 19257-2.patch, 9.5 KB (added by , 10 years ago) |
---|
-
src/wp-admin/edit-form-advanced.php
208 208 add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); 209 209 210 210 if ( $thumbnail_support && current_user_can( 'upload_files' ) ) 211 add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');211 add_meta_box('postimagediv', $post_type_object->labels->featured_image, 'post_thumbnail_meta_box', null, 'side', 'low'); 212 212 213 213 if ( post_type_supports($post_type, 'excerpt') ) 214 214 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core'); … … 366 366 } 367 367 368 368 if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) { 369 $publish_box .= '<li>' . __('<strong>Featured Image</strong> - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '</li>';369 $publish_box .= '<li>' . sprintf( __('<strong>%s</strong> - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.'), $post_type_object->labels->featured_image ) . '</li>'; 370 370 } 371 371 372 372 $publish_box .= '</ul>'; -
src/wp-admin/includes/media.php
1488 1488 } 1489 1489 if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) 1490 1490 && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) { 1491 1492 $calling_post = get_post( $calling_post_id ); 1493 $calling_post_type_object = get_post_type_object( $calling_post->post_type ); 1494 1491 1495 $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" ); 1492 $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>";1496 $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>"; 1493 1497 } 1494 1498 1495 1499 if ( ( $r['send'] || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) { … … 1724 1728 * @since 2.5.0 1725 1729 */ 1726 1730 function media_upload_header() { 1731 1727 1732 $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; 1728 echo '<script type="text/javascript">post_id = ' . $post_id . ";</script>\n"; 1733 1734 if ( ! empty( $post_id ) ) { 1735 $post_type = get_post_type( $post_id ); 1736 } else { 1737 $post_type = ''; 1738 } 1739 1740 echo '<script type="text/javascript">post_id = ' . $post_id . ';post_type = ' . $post_type . ';</script>'; 1729 1741 if ( empty( $_GET['chromeless'] ) ) { 1730 1742 echo '<div id="media-upload-header">'; 1731 1743 the_media_upload_tabs(); -
src/wp-admin/includes/post.php
1345 1345 function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { 1346 1346 global $content_width, $_wp_additional_image_sizes; 1347 1347 1348 $post = get_post( $post ); 1349 1348 $post = get_post( $post ); 1349 $post_type_object = get_post_type_object( $post->post_type ); 1350 $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr( $post_type_object->labels->set_featured_image ) . '" href="%s" id="set-post-thumbnail" class="thickbox">%s</a></p>'; 1350 1351 $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post->ID ) ); 1351 $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="%s" id="set-post-thumbnail" class="thickbox">%s</a></p>';1352 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) );1353 1352 1353 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html( $post_type_object->labels->set_featured_image ) ); 1354 1354 1355 if ( $thumbnail_id && get_post( $thumbnail_id ) ) { 1355 1356 $old_content_width = $content_width; 1356 1357 $content_width = 266; … … 1361 1362 if ( !empty( $thumbnail_html ) ) { 1362 1363 $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID ); 1363 1364 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, $thumbnail_html ); 1364 $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>';1365 $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>'; 1365 1366 } 1366 1367 $content_width = $old_content_width; 1367 1368 } -
src/wp-admin/js/set-post-thumbnail.js
9 9 action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie ) 10 10 }, function(str){ 11 11 var win = window.dialogArguments || opener || parent || top; 12 $link.text( setPostThumbnailL10n.setThumbnail ); 12 setThumbnail = 'setThumbnail_' + post_type; 13 $link.text( setPostThumbnailL10n[setThumbnail] ); 13 14 if ( str == '0' ) { 14 15 alert( setPostThumbnailL10n.error ); 15 16 } else { -
src/wp-includes/media.php
2991 2991 2992 2992 $hier = $post && is_post_type_hierarchical( $post->post_type ); 2993 2993 2994 $post_type_object = get_post_type_object( $post->post_type ); 2995 2994 2996 $strings = array( 2995 2997 // Generic 2996 2998 'url' => __( 'URL' ), … … 3049 3051 'insertFromUrlTitle' => __( 'Insert from URL' ), 3050 3052 3051 3053 // Featured Images 3052 'setFeaturedImageTitle' => __( 'Set Featured Image' ),3053 'setFeaturedImage' => __( 'Set featured image' ),3054 'setFeaturedImageTitle' => $post_type_object->labels->featured_image, 3055 'setFeaturedImage' => $post_type_object->labels->set_featured_image, 3054 3056 3055 3057 // Gallery 3056 3058 'createGalleryTitle' => __( 'Create Gallery' ), -
src/wp-includes/post.php
1639 1639 'not_found' => array( __('No posts found.'), __('No pages found.') ), 1640 1640 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), 1641 1641 'parent_item_colon' => array( null, __('Parent Page:') ), 1642 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ) 1642 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), 1643 'featured_image' => array( __( 'Featured Image' ), __( 'Featured Image' ) ), 1644 'set_featured_image' => array( __( 'Set featured image' ), __( 'Set featured image' ) ), 1645 'remove_featured_image' => array( __( 'Remove featured image' ), __( 'Remove featured image' ) ), 1646 'use_featured_image' => array( __( 'Use as featured image' ), __( 'Use as featured image' ) ) 1643 1647 ); 1644 1648 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1645 1649 -
src/wp-includes/script-loader.php
570 570 'error' => __( 'Could not load the preview image. Please reload the page and try again.' ) 571 571 )); 572 572 573 $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); 574 did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( 575 'setThumbnail' => __( 'Use as featured image' ), 573 $setPostThumbnailL10n = array( 574 'setThumbnail' => __( 'Use as featured image' ), // Back compat 576 575 'saving' => __( 'Saving...' ), 577 576 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ), 578 577 'done' => __( 'Done' ) 579 ) );578 ); 580 579 580 foreach ( get_post_types( null, 'objects' ) as $post_type_object ) { 581 if ( isset( $post_type_object->labels->use_featured_image ) ) { 582 $setPostThumbnailL10n["setThumbnail_{$post_type_object->name}"] = $post_type_object->labels->use_featured_image; 583 } 584 } 585 $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); 586 did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', $setPostThumbnailL10n ); 587 588 581 589 // Navigation Menus 582 590 $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox' ) ); 583 591 did_action( 'init' ) && $scripts->localize( 'nav-menu', 'navMenuL10n', array(