Revert a part of [32673] that caused a fatal error with SCRIPT_DEBUG disabled.

see #19257.

git-svn-id: https://develop.svn.wordpress.org/trunk@32676 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2015-06-01 04:13:17 +00:00
parent 3aad7082a3
commit 9940e8c16f
2 changed files with 5 additions and 13 deletions

View File

@@ -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' ) );