onetone_enqueue_less_styles

Load less.

Description

onetone_enqueue_less_styles( $tag, $handle ); 

Parameters (2)

0. $tag
The tag.
1. $handle
The handle.

Usage

  1. if ( !function_exists( 'onetone_enqueue_less_styles' ) ) { 
  2. require_once '/includes/theme-functions.php'; 
  3.  
  4. // The tag. 
  5. $tag = null; 
  6.  
  7. // The handle. 
  8. $handle = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = onetone_enqueue_less_styles($tag, $handle); 
  12.  

Defined (1)

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

/includes/theme-functions.php  
  1. function onetone_enqueue_less_styles($tag, $handle) { 
  2.  
  3. global $wp_styles; 
  4. $match_pattern = '/\.less$/U'; 
  5. if ( preg_match( $match_pattern, $wp_styles->registered[$handle]->src ) ) { 
  6. $handle = $wp_styles->registered[$handle]->handle; 
  7. $media = $wp_styles->registered[$handle]->args; 
  8. $href = $wp_styles->registered[$handle]->src . '?ver=' . $wp_styles->registered[$handle]->ver; 
  9. $rel = isset($wp_styles->registered[$handle]->extra['alt']) && $wp_styles->registered[$handle]->extra['alt'] ? 'alternate stylesheet' : 'stylesheet'; 
  10. $title = isset($wp_styles->registered[$handle]->extra['title']) ? "title='" . esc_attr( $wp_styles->registered[$handle]->extra['title'] ) . "'" : ''; 
  11.  
  12. $tag = "<link rel='stylesheet' id='$handle' $title href='$href' type='text/less' media='$media' />\n"; 
  13. return $tag;