
CORRECTING THEMEZILLA BAD BEHAVIOR
By:
brasofilo on
Jan 4th, 2013 | syntax:
PHP | size: 0.68 KB | hits: 34 | expires: Never
add_action( 'admin_enqueue_scripts', 'block_theme_spitting', 11 );
function block_theme_spitting()
{
global $current_screen;
// Correct pages, do nothing
if(
'launch_page_zillaframework-themes' == $current_screen->base
|| 'launch_page_zillaframework-update' == $current_screen->base
|| 'toplevel_page_zillaframework' == $current_screen->base
)
return;
// Deregister wrongfully enqueued scripts
$deregister = array(
'zilla-ajaxupload',
'zilla-jgrowl',
'zilla-admin',
'zilla-framework-admin',
'zilla-upload'
);
foreach( $deregister as $dreg )
{
if( wp_script_is( $dreg,'registered' ) ) {
wp_dequeue_script($dreg);
}
}
}