WordPress.org

Make WordPress Core

Changeset 32676


Ignore:
Timestamp:
06/01/2015 04:13:17 AM (4 years ago)
Author:
SergeyBiryukov
Message:

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

see #19257.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/set-post-thumbnail.js

    r32673 r32676  
    1010    }, function(str){
    1111        var win = window.dialogArguments || opener || parent || top;
    12         setThumbnail = 'setThumbnail_' + post_type;
    13         $link.text( setPostThumbnailL10n[ setThumbnail ] );
     12        $link.text( setPostThumbnailL10n.setThumbnail );
    1413        if ( str == '0' ) {
    1514            alert( setPostThumbnailL10n.error );
  • trunk/src/wp-includes/script-loader.php

    r32673 r32676  
    571571        ));
    572572
    573         $setPostThumbnailL10n = array(
    574             'setThumbnail' => __( 'Use as featured image' ), // Back compat
     573        $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 );
     574        did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
     575            'setThumbnail' => __( 'Use as featured image' ),
    575576            'saving' => __( 'Saving...' ),
    576577            'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
    577578            'done' => __( 'Done' )
    578         );
    579 
    580         foreach ( get_post_types( null, 'objects' ) as $post_type_object ) {
    581             if ( isset( $post_type_object->labels->use_featured_image ) ) {
    582                 $setPostThumbnailL10n[ "setThumbnail_{$post_type_object->name}" ] = $post_type_object->labels->use_featured_image;
    583             }
    584         }
    585         $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 );
    586         did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', $setPostThumbnailL10n );
     579        ) );
    587580
    588581        // Navigation Menus
Note: See TracChangeset for help on using the changeset viewer.