May be this question has been already posted but i don't found anything.
Few days ago i wrote a little plugin and what i want to do has been impossible with the actual filters or actions.
Why don't put a callback in the begin and end of the functions? Obviously returning errors and exit from the function before the execution of the body.
I mean some thing like this:
function wp_function(...) {
if( do_action( 'wp_function_before', ... ) ) {
return ERROR;
}
// body
if( do_action( 'wp_function_after', ... ) ) {
return ERROR;
}
}