I developed a plugin having a custom metabox that is using the save_post
hook to store data. The plugin is 18 months old and is used by thousands of customers, so I’m pretty sure everything is good.
Since I updated my testing platform to v3.6.1, I can’t get that hook to run on previously created pages/posts. It only works on new ones.
(I am the only WP user in the website. WP DEBUG is enabled)
Has anyone experienced the same? Any clue? I missed some changes?
EDIT:
The code I’m using now to check the hook is this (I’ve deleted the inner code for privacy reasons):
function saving_metabox($post_id) {
die('test');
if(isset($_POST['plugin_noncename'])) {
... ...
}
return $post_id;
}
add_action('save_post', 'saving_metabox');
Try changing your content and saving again. This will trigger the action.
save_post
is only called if the content has changed.To come in before this is checked, you can use the
pre_post_update
hook.