How to intercept publish post for a custom post type “event”

Read the codex, that’s where i finally found the answer :

https://codex.wordpress.org/Plugin_API/Action_Reference/publish_post

in the end :

Custom Post Types

To trigger this action for a custom post type, use publish_{$custom_post_type}. e.g. if your post type is ‘book’ use:

add_action( 'publish_book', 'post_published_notification', 10, 2 );

Leave a Comment

tech