Make WordPress Core

Changeset 28840


Ignore:
Timestamp:
06/26/2014 01:37:13 AM (11 years ago)
Author:
wonderboymusic
Message:

In wp_localize_script(), instantiate the $wp_scripts global instead of bailing when it is called before wp_enqueue_scripts. This allows wp_enqueue_media() to be called on the front end with no JS errors.

Props ericlewis.
Fixes #24724.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.wp-scripts.php

    r25949 r28840  
    117117            _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    118118                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
    119 
    120         return false;
     119        $wp_scripts = new WP_Scripts();
    121120    }
    122121
Note: See TracChangeset for help on using the changeset viewer.