diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php
index 5b5abb0ccf..0724a88c71 100644
--- a/src/wp-admin/edit-form-advanced.php
+++ b/src/wp-admin/edit-form-advanced.php
@@ -213,7 +213,7 @@ if ( post_type_supports($post_type, 'page-attributes') )
add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core');
if ( $thumbnail_support && current_user_can( 'upload_files' ) )
- add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
+ add_meta_box('postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low');
if ( post_type_supports($post_type, 'excerpt') )
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core');
@@ -371,7 +371,8 @@ if ( 'post' == $post_type ) {
}
if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
- $publish_box .= '
' . __('Featured Image - 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.') . '';
+ /* translators: %s: Featured Image */
+ $publish_box .= '' . sprintf( __( '%s - 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 image as a post thumbnail on the home page, a custom header, etc.' ), esc_html( $post_type_object->labels->featured_image ) ) . '';
}
$publish_box .= '';
diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index bb3b4a079c..cf1beb6d8d 100644
--- a/src/wp-admin/includes/media.php
+++ b/src/wp-admin/includes/media.php
@@ -1493,8 +1493,12 @@ function get_media_item( $attachment_id, $args = null ) {
}
if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
&& post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
+
+ $calling_post = get_post( $calling_post_id );
+ $calling_post_type_object = get_post_type_object( $calling_post->post_type );
+
$ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
- $thumbnail = "" . esc_html__( "Use as featured image" ) . "";
+ $thumbnail = "" . esc_html( $calling_post_type_object->labels->use_featured_image ) . "";
}
if ( ( $r['send'] || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) {
@@ -1736,8 +1740,16 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
* @since 2.5.0
*/
function media_upload_header() {
+
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
- echo '\n";
+
+ if ( ! empty( $post_id ) ) {
+ $post_type = get_post_type( $post_id );
+ } else {
+ $post_type = '';
+ }
+
+ echo '';
if ( empty( $_GET['chromeless'] ) ) {
echo '