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');
save_post
hook code that you're using (ie, the function you're trying to run) to your question.return
, only if you want to break further execution. Does thatdie()
has any effect? If you disable all other plugins, does the issue persist?save_post
hook is still triggered. So if you have disabled any other plugin and tested on twentythirteen theme, the wrong code is in your plugin. Try to enable logging (not only debug) and read the log, maybe you'll find some info there.