yit_load_js_file

Load .min.js file if WP_Debug is not defined.

Description

(string) yit_load_js_file( (string) $filename ); 

Returns (string)

The file path

Parameters (1)

0. $filename (string)
The filename.

Usage

  1. if ( !function_exists( 'yit_load_js_file' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-compare/plugin-fw/yit-functions.php'; 
  3.  
  4. // The filename. 
  5. $filename = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = yit_load_js_file($filename); 
  9.  

Defined (1)

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

/plugin-fw/yit-functions.php  
  1. function yit_load_js_file ( $filename ) { 
  2.  
  3. if ( ! ( ( defined ( 'WP_DEBUG' ) && WP_DEBUG ) || ( defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) || isset( $_GET['yith_script_debug'] ) ) ) { 
  4. $filename = str_replace ( '.js', '.min.js', $filename ); 
  5.  
  6. return $filename;