diff --git a/src/wp-admin/js/set-post-thumbnail.js b/src/wp-admin/js/set-post-thumbnail.js index fb17351a25..68abbcc830 100644 --- a/src/wp-admin/js/set-post-thumbnail.js +++ b/src/wp-admin/js/set-post-thumbnail.js @@ -9,8 +9,7 @@ function WPSetAsThumbnail( id, nonce ) { action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie ) }, function(str){ var win = window.dialogArguments || opener || parent || top; - setThumbnail = 'setThumbnail_' + post_type; - $link.text( setPostThumbnailL10n[ setThumbnail ] ); + $link.text( setPostThumbnailL10n.setThumbnail ); if ( str == '0' ) { alert( setPostThumbnailL10n.error ); } else { diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 991e78e13e..6cd361b5d3 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -570,20 +570,13 @@ function wp_default_scripts( &$scripts ) { 'error' => __( 'Could not load the preview image. Please reload the page and try again.' ) )); - $setPostThumbnailL10n = array( - 'setThumbnail' => __( 'Use as featured image' ), // Back compat + $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); + did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( + 'setThumbnail' => __( 'Use as featured image' ), 'saving' => __( 'Saving...' ), 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ), 'done' => __( 'Done' ) - ); - - foreach ( get_post_types( null, 'objects' ) as $post_type_object ) { - if ( isset( $post_type_object->labels->use_featured_image ) ) { - $setPostThumbnailL10n[ "setThumbnail_{$post_type_object->name}" ] = $post_type_object->labels->use_featured_image; - } - } - $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); - did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', $setPostThumbnailL10n ); + ) ); // Navigation Menus $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox' ) );