| | 11 | function wp_scripts() { |
| | 12 | global $wp_scripts; |
| | 13 | if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { |
| | 14 | $wp_scripts = new WP_Scripts(); |
| | 15 | } |
| | 16 | return $wp_scripts; |
| | 17 | } |
| | 18 | |
| | 19 | function wp_scripts_maybe_doing_it_wrong( $function ) { |
| | 20 | if ( did_action( 'init' ) ) { |
| | 21 | return; |
| | 22 | } |
| | 23 | |
| | 24 | _doing_it_wrong( $function, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), |
| | 25 | '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); |
| | 26 | } |
| | 27 | |
| 37 | | global $wp_scripts; |
| 38 | | if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { |
| 39 | | if ( ! did_action( 'init' ) ) |
| 40 | | _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), |
| 41 | | '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); |
| | 55 | wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); |
| 74 | | global $wp_scripts; |
| 75 | | if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { |
| 76 | | if ( ! did_action( 'init' ) ) |
| 77 | | _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), |
| 78 | | '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); |
| 79 | | $wp_scripts = new WP_Scripts(); |
| 80 | | } |
| | 85 | $wp_scripts = wp_scripts(); |
| | 86 | wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); |
| 142 | | global $wp_scripts; |
| 143 | | if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { |
| 144 | | if ( ! did_action( 'init' ) ) |
| 145 | | _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), |
| 146 | | '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); |
| 147 | | $wp_scripts = new WP_Scripts(); |
| 148 | | } |
| | 146 | wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); |
| 198 | | global $wp_scripts; |
| 199 | | if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { |
| 200 | | if ( ! did_action( 'init' ) ) |
| 201 | | _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), |
| 202 | | '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); |
| 203 | | $wp_scripts = new WP_Scripts(); |
| 204 | | } |
| | 196 | $wp_scripts = wp_scripts(); |
| 230 | | global $wp_scripts; |
| 231 | | if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { |
| 232 | | if ( ! did_action( 'init' ) ) |
| 233 | | _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), |
| 234 | | '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); |
| 235 | | $wp_scripts = new WP_Scripts(); |
| 236 | | } |
| | 224 | wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); |
| 255 | | global $wp_scripts; |
| 256 | | if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { |
| 257 | | if ( ! did_action( 'init' ) ) |
| 258 | | _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), |
| 259 | | '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); |
| 260 | | $wp_scripts = new WP_Scripts(); |
| 261 | | } |
| | 243 | wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); |