wp_enqueue_scripts

Wrapper for do_action('wp_enqueue_scripts').

Description

wp_enqueue_scripts(); 

Allows plugins to queue scripts for the front end using wp_enqueue_script(). Runs first in wp_head() where all is_home(), is_page(), etc. functions are available.


Usage

  1. if ( !function_exists( 'wp_enqueue_scripts' ) ) { 
  2. require_once ABSPATH . WPINC . '/script-loader.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_enqueue_scripts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/script-loader.php  
  1. function wp_enqueue_scripts() { 
  2. /** 
  3. * Fires when scripts and styles are enqueued. 
  4. * @since 2.8.0 
  5. */