Make WordPress Core


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

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

see #19257.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.