mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 12:14:25 +00:00
Introduce featured_image, set_featured_image, remove_featured_image, and use_featured_image post type labels when registering a post type in order to override the 'Featured Image' text and its related phrases.
Props johnbillion, mordauk, valendesigns. Fixes #19257. git-svn-id: https://develop.svn.wordpress.org/trunk@32673 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -570,13 +570,20 @@ function wp_default_scripts( &$scripts ) {
|
||||
'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
|
||||
));
|
||||
|
||||
$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' ),
|
||||
$setPostThumbnailL10n = array(
|
||||
'setThumbnail' => __( 'Use as featured image' ), // Back compat
|
||||
'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' ) );
|
||||
|
||||
Reference in New Issue
Block a user