Want more features on Pastebin? Sign Up, it's FREE!
Guest

CORRECTING THEMEZILLA BAD BEHAVIOR

By: brasofilo on Jan 4th, 2013  |  syntax: PHP  |  size: 0.68 KB  |  views: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data