You can try this (untested):
add_action( 'wp_head',
function(){
// your conditions:
if( is_home() || is_category() )
{
// access the global SyntaxHighlighter object instantiated at 'init'.
global $SyntaxHighlighter;
// remove your action hooks:
remove_action( 'wp_head',
array( $SyntaxHighlighter, 'output_header_placeholder' ),
15 );
remove_action( 'wp_footer',
array( $SyntaxHighlighter, 'maybe_output_scripts' ),
15 );
}
}
);
to remove these action hooks conditionally with template tags. We use the wp_head
action with the default priority 10
.
You can use other hooks but they must fire earlier than wp_head
with priority 15
and after the $SyntaxHighlighter
object creation via the init hook.
You must also make sure that your template tags, you want to use in your conditional checks, are available in the hook you choose.