yit_enqueue_style

Enqueues style.

Description

yit_enqueue_style( $handle, $src, (array) $deps = array(), (constant) $ver = false, (string) $media = 'all' ); 

Registers the style 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. $media — Optional. (string) => 'all'
The media.

Usage

  1. if ( !function_exists( 'yit_enqueue_style' ) ) { 
  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 media. 
  17. $media = 'all'; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = yit_enqueue_style($handle, $src, $deps, $ver, $media); 
  21.  

Defined (1)

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

/plugin-fw/yit-functions.php  
  1. function yit_enqueue_style ( $handle, $src, $deps = array (), $ver = false, $media = 'all' ) { 
  2.  
  3. if ( function_exists ( 'YIT_Asset' ) ) { 
  4. $enqueue = true; 
  5. $who = YIT_Asset ()->get_stylesheet_handle ( get_stylesheet_uri (), 'style' ); 
  6. $where = 'before'; 
  7.  
  8. if ( false == $who ) { 
  9. $who = ''; 
  10.  
  11. YIT_Asset ()->set ( 'style', $handle, compact ( 'src', 'deps', 'ver', 'media', 'enqueue' ), $where, $who ); 
  12. } else { 
  13. wp_enqueue_style ( $handle, $src, $deps, $ver, $media );