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

see #19257.
Built from https://develop.svn.wordpress.org/trunk@32676


git-svn-id: http://core.svn.wordpress.org/trunk@32646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-06-01 04:14:25 +00:00
parent 3fc78a1109
commit ecf0bcc9fc
4 changed files with 7 additions and 15 deletions

View File

@ -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 {

View File

@ -1 +1 @@
function WPSetAsThumbnail(a,b){var c=jQuery("a#wp-post-thumbnail-"+a);c.text(setPostThumbnailL10n.saving),jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:a,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(b){var d=window.dialogArguments||opener||parent||top;setThumbnail="setThumbnail_"+post_type,c.text(setPostThumbnailL10n[setThumbnail]),"0"==b?alert(setPostThumbnailL10n.error):(jQuery("a.wp-post-thumbnail").show(),c.text(setPostThumbnailL10n.done),c.fadeOut(2e3),d.WPSetThumbnailID(a),d.WPSetThumbnailHTML(b))})}
function WPSetAsThumbnail(a,b){var c=jQuery("a#wp-post-thumbnail-"+a);c.text(setPostThumbnailL10n.saving),jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:a,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(b){var d=window.dialogArguments||opener||parent||top;c.text(setPostThumbnailL10n.setThumbnail),"0"==b?alert(setPostThumbnailL10n.error):(jQuery("a.wp-post-thumbnail").show(),c.text(setPostThumbnailL10n.done),c.fadeOut(2e3),d.WPSetThumbnailID(a),d.WPSetThumbnailHTML(b))})}

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

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32675';
$wp_version = '4.3-alpha-32676';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.