Advertisement
brasofilo

CORRECTING THEMEZILLA BAD BEHAVIOR

Jan 4th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. add_action( 'admin_enqueue_scripts', 'block_theme_spitting', 11 );
  2.  
  3. function block_theme_spitting()
  4. {
  5.     global $current_screen;
  6.  
  7.     // Correct pages, do nothing
  8.     if(
  9.         'launch_page_zillaframework-themes' == $current_screen->base
  10.         || 'launch_page_zillaframework-update' == $current_screen->base
  11.         || 'toplevel_page_zillaframework' == $current_screen->base
  12.     )
  13.         return;
  14.  
  15.     // Deregister wrongfully enqueued scripts
  16.     $deregister = array(
  17.         'zilla-ajaxupload',
  18.         'zilla-jgrowl',
  19.         'zilla-admin',
  20.         'zilla-framework-admin',
  21.         'zilla-upload'
  22.     );
  23.    
  24.     foreach( $deregister as $dreg )
  25.     {
  26.         if( wp_script_is( $dreg,'registered' ) ) {
  27.             wp_dequeue_script($dreg);
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement