jetpack_register_css_preprocessors

CSS preprocessor registration.

Description

(array) jetpack_register_css_preprocessors( (array) $preprocessors ); 

To add a new preprocessor (or replace an existing one), hook into the jetpack_custom_css_preprocessors filter and add an entry to the array that is passed in.

Format is: $preprocessors[ UNIQUE_KEY ] => array( name => Processor name,, callback => [processing function] );

The callback function accepts a single string argument (non-CSS markup) and returns a string (CSS).

Returns (array)

Parameters (1)

0. $preprocessors (array)
The list of preprocessors added thus far.

Usage

  1. if ( !function_exists( 'jetpack_register_css_preprocessors' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/custom-css/custom-css/preprocessors.php'; 
  3.  
  4. // The list of preprocessors added thus far. 
  5. $preprocessors = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = jetpack_register_css_preprocessors($preprocessors); 
  9.  

Defined (1)

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

/modules/custom-css/custom-css/preprocessors.php  
  1. function jetpack_register_css_preprocessors( $preprocessors ) { 
  2. $preprocessors['less'] = array( 
  3. 'name' => 'LESS',  
  4. 'callback' => 'jetpack_less_css_preprocess
  5. ); 
  6.  
  7. $preprocessors['sass'] = array( 
  8. 'name' => 'Sass (SCSS Syntax)',  
  9. 'callback' => 'jetpack_sass_css_preprocess
  10. ); 
  11.  
  12. return $preprocessors;