What hook gets called when I edit or publish a custom post type of name ‘episode gallery’ ?

I tried following but none worked.

add_action('save_post', 'update_custom_ngg_table');
add_action('update_postmeta', 'update_custom_ngg_table');
add_action('publish_post', 'update_custom_ngg_table');
add_action('edit_post', 'update_custom_ngg_table');
add_action('edit_page', 'update_custom_ngg_table');
add_action('publish_page', 'update_custom_ngg_table');
add_action('save_page', 'update_custom_ngg_table');
add_action('publish_episode-gallery', 'update_custom_ngg_table');

I am about to give up 🙂

4 Answers
4

Unless I misunderstand your question, you want {$new_status}_{my-custom-post-type}

Take a look at the hook registration.

This page (from Pippin’s Posts)* does a better job than I could at explaining it, but from your example, you would want add_action('publish_episode-gallery', 'update_custom_ngg_table');

According to the source, the following status are available:
publish, future, draft, pending, private, trash, auto-draft and inherit.

* Mirror at the Web Archive

Leave a Reply

Your email address will not be published. Required fields are marked *