Created
          September 15, 2016 14:17 
        
      - 
      
- 
        Save max-kk/33d81371e3c9eb59c6d1f1b6f50f3c43 to your computer and use it in GitHub Desktop. 
    text/rocketscript excluder
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| add_filter( 'script_loader_tag', function ( $tag, $handle ) { | |
| //var_dump($handle); | |
| $handles_to_exclude = array('fv_main_js'=> 0,'fv_theme_story'=>0, 'fv_lib_js'=>0, 'fv_evercookie'=>0, 'jquery-core'=>0, 'jquery-migrate'=>0); | |
| if ( !isset($handles_to_exclude[$handle]) ) return $tag; | |
| if ( 'fv_main_js' == $handle ) { | |
| global $wp_scripts; | |
| $tag = '<script data-cfasync="false">' . $wp_scripts->print_extra_script( $handle, false ) . '</script>' . $tag; | |
| } | |
| return str_replace( "type='text/javascript' src", ' data-cfasync="false" src', $tag ); | |
| }, 0, 2 ); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment