SHARE
TWEET

Untitled

a guest Jun 18th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Move render-blocking JavaScript.
  2. add_action( 'wp_enqueue_scripts', 'custom_clean_head', 9999999 );
  3. function custom_clean_head() {  
  4.    remove_action('wp_head', 'wp_print_scripts');
  5.    remove_action('wp_head', 'wp_print_head_scripts', 9);
  6.    remove_action('wp_head', 'wp_enqueue_scripts', 1);
  7.  
  8.    add_action('wp_footer', 'wp_print_scripts', 5);  
  9.    add_action('wp_footer', 'wp_print_head_scripts', 5);
  10.    add_action('wp_footer', 'wp_enqueue_scripts', 5);
  11. }
  12.      
  13. add_action( 'wp_enqueue_scripts', 'my_plugin', 999999999 );
  14. function my_plugin( ) {
  15.     // assigning slug variables
  16.     wp_enqueue_script( $plugin_short_slug, plugins_url() . '/' . $plugin_slug . '/js/' . $plugin_slug . '.min.js', array(), '', false);
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top