I'm trying to disable the load of nextgen gallery 2.x styles and scripts, I used
function mytheme_deregister_scripts_and_styles(){
$unwanted_scripts = array(
'photocrati_ajax'
);
foreach ( $unwanted_scripts as $script ) {
wp_dequeue_script( $script );
wp_deregister_script( $script );
}
$unwanted_styles = array(
'photocrati-nextgen_basic_compact_album'
);
foreach ( $unwanted_styles as $style ) {
wp_dequeue_style( $style );
wp_deregister_style( $style );
}
// to display their handles
/* global $wp_scripts;
echo '<div style="position:absolute; left:200px; top:200px; background:white; z-index:100;">';
foreach( $wp_scripts->queue as $handle ) :
echo "<p>";
echo $handle;
echo "</p>";
endforeach;
echo "</div>"; */
}
add_action( 'wp_enqueue_scripts', 'mytheme_deregister_scripts_and_styles', 99 );
**SCRIPTS AND STYLES LIST:**
However, nothing changed the styles are still being loaded. What is wrong with the code, and how to fix it?
wp_print_styles? I'd bet they're actually hooked towp_enqueue_scripts.