I have a plugin that I want to ensure runs ONLY on singular posts, pages, etc. I'm using the is_singular() function and it works great - except that all it does is return execution to the rest of the plugin if I do this:
function singular_check(){
if(is_singular())
return;
}
I'm executing it in a hook like so:
add_action('wp', 'singular_check');
I need to actually make my entire plugin bail out at that point, and return to executing whatever else was downstream of my plugin. Anyone know how to do so?
init
? Thewp
action(where you conditional logic is) occurs after init, so do you have anything happening before that action? You should be fine if you're adding actions/filters at that point as you can simply unhook/unregister them.. but you need to give more substance to your question. What you're asking is entirely possible, but without more details about what you're doing it's hard to provide a specific example..(a general one could be given but it may not address your use case).