Q: WordPress save_post hook not firing when checking if _GET['post'] is set I was facing an issue (a custom metabox not saving), and after 2 hours I finally realised that, if you try to add an action to the save_post hook inside an if statement checking whether $_GET['post'] is set, it won't work.
Basically, even if $_GET['post'] is set, if you put this code in your functions.php, it won't work:
function foo() {
    die('Saving post');
}
if( isset($_GET['post']) ) {
    add_action( 'save_post', 'foo' );
}

I tried to reproduce this with other hooks, but save_post seems to be the only one that behaves like this.
I wonder why this happens?

A: How is $_GET['post'] set ?  And why are you checking it? 
It could be that you're adding the save_post call too late. 
Try:
function foo() {
    die('Saving post');
}

function foo2() {
    if( isset($_GET['post']) ) 
        foo();
}
add_action( 'save_post', 'foo2' );

