예제 #1
0
 /**
  * Enqueue script/style
  *
  * @param unknown $file_uri
  * @param unknown $js_file
  */
 private static function asset_enqueue_($file_uri, $js_file, $file_path)
 {
     $enqueue = 0;
     $handle = WR_Megamenu_Init_Assets::file_to_handle($js_file);
     if (is_admin()) {
         $enqueue = 1;
     } else {
         // $wr_mm_settings_cache = get_option( 'wr_mm_settings_cache', 'enable' );
         //
         // if ( $wr_mm_settings_cache == 'enable' ) {
         // self::store_assets_info( $handle, $file_uri, $file_path );
         // } else {
         $enqueue = 1;
         // }
     }
     if ($enqueue) {
         WR_Megamenu_Init_Assets::load($handle, $file_uri);
     }
 }
예제 #2
0
 /**
  * Method to load specified asset.
  *
  * @param   string  $handle  Asset handle.
  *
  * @return  void
  */
 protected function load_asset($handle)
 {
     if (is_array($handle)) {
         foreach ($handle as $h) {
             $this->load_asset($h);
         }
         return;
     }
     // Prepare asset handle
     if (preg_match('/\\.(css|js)$/', $handle)) {
         $handle = WR_Megamenu_Init_Assets::file_to_handle($handle);
     }
     // Load asset
     WR_Megamenu_Init_Assets::load($handle);
 }