yit_enqueue_script

Enqueues script.

Description

yit_enqueue_script( $handle, $src, (array) $deps = array(), (constant) $ver = false, (bool) $in_footer = true ); 

Registers the script if src provided (does NOT overwrite) and enqueues.

Parameters (5)

0. $handle
The handle.
1. $src
The src.
2. $deps — Optional. (array) => array()
The deps.
3. $ver — Optional. (constant) => false
The ver.
4. $in_footer — Optional. (bool) => true
The in footer.

Usage

  1. if ( !function_exists( 'yit_enqueue_script' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-compare/plugin-fw/yit-functions.php'; 
  3.  
  4. // The handle. 
  5. $handle = null; 
  6.  
  7. // The src. 
  8. $src = null; 
  9.  
  10. // The deps. 
  11. $deps = array(); 
  12.  
  13. // The ver. 
  14. $ver = false; 
  15.  
  16. // The in footer. 
  17. $in_footer = true; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = yit_enqueue_script($handle, $src, $deps, $ver, $in_footer); 
  21.  

Defined (1)

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

/plugin-fw/yit-functions.php  
  1. function yit_enqueue_script ( $handle, $src, $deps = array (), $ver = false, $in_footer = true ) { 
  2.  
  3. if ( function_exists ( 'YIT_Asset' ) && ! is_admin () ) { 
  4. $enqueue = true; 
  5. YIT_Asset ()->set ( 'script', $handle, compact ( 'src', 'deps', 'ver', 'in_footer', 'enqueue' ) ); 
  6. } else { 
  7. wp_enqueue_script ( $handle, $src, $deps, $ver, $in_footer );