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 );
Related Posts:
- How to enqueue scripts on custom post add/edit pages?
- remove custom post type permalink
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Action hook on Edit custom post type?
- Unregister post type from child theme
- Custom post type save_post action not firing
- How to correctly get post type in a the_title filter
- Why The Init Hook For Custom Post Types
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- How to show more posts on an archive page?
- With what hook can I address all posts from all custom post types when they are published?
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- Dynamically Create Terms in Taxonomy when Custom Post Type is Published. Almost There!
- WordPress Custom Shortcode Conflicting with Media Library
- WordPress custom post action hook
- action init hook and get_post_types
- Custom post type archive sorted and grouped by date in post meta field
- What hook should be used to programmatically create a post only when master post is updated?
- pre get posts changing the query
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Using pre_get_posts to Filter Posts
- Remove “Get Shortlink” button in admin of custom post type
- update_post_meta() whenever custom post type is updated
- How to get Custom Post ID by adding filter to child theme’s function
- Custom post_type search’s $wp_query->query_vars do not correspond
- Check Title Unique Or Not and If not error message and dont save
- Can’t unregister parent theme’s CPT from my child theme
- Add html to cpt main page / admin edit.php
- register_taxonomy and register_post_type does not work [closed]
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Custom post type unintentionally called in every page
- Displaying custom taxonomy in the admin list of a custom post type
- Can taxonomies of custom post types be used with category actions?
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- How do I add a custom screen for a custom post type to be called from custom post row action?
- Custom post type suppress transition from future to publish
- Filter Posts from the Main Query
- Using preg_replace to filter custom textarea
- Create new custom post and post category of same name
- Use remove_meta_box conditionally on custom post type
- Include php on a specific page template
- wp_trash_post action hook with custom post type
- How do I amend form data before it is saved for a custom post type
- What do the numbers mean at the end of add_action(‘save_post’)…?
- Running a wordpress action when a custom post type term (taxonomy category) is changed
- Types plugin custom post add_action hooks
- Loading plugin text domain before registering post type
- How can I get some of a posts meta data whilst it is still inserting?
- add_action ‘init’ from inside a class for custom post types
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?
- Using `set_transient()` when saving a custom post type
- Using publish_{custom-post-type} hook for custom post type to update meta doesn’t work
- Post Click Redirect to Custom URL instead of Single Post Page
- publish_post action callback not executed, why?
- How to store additional data that is related to core data
- Keep br tags from stripping
- do action inside a class is not working
- Filter wp_dropdown_categories Per Post Type
- What is the proper way implement a global $wp_rewrite?
- Dynamically change post_parent in every page load?
- Create action running on trashed_post hook to modify post_meta value
- Custom post type functions.php if statement on action
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- Rewrite custom post type rss feed links
- Limit the number of posts in query_posts function with custom post types
- “Edit” option for custom post types archive page
- Child pages on hierarchical Custom Post Types 404s
- Custom Post Types: pretty search URLs and has_archive
- Filter posts with ajax form and checkboxes
- Custom Scripts per page or Custom Post Type
- Count posts with specific term_meta
- submenu item edit a specific post
- Confusion regarding Nonce & using it in Custom Columns for Saving Checkbox Value to Post Meta
- Replace text in post from cvs
- Admin search ACF relationship
- With two custom post types, how to make one a child of the other in the admin menu?
- WordPress sort search results by custom order
- How to change permalink to include custom post type
- Listing all term items alphabetically / sorting loop
- Single page not working for custom post type
- Custom Post Type “MUST NOT” be able to search via URL
- How to add and display custom content that is not a post
- CPT structure questions
- Adding custom post formatting options in custom post types
- Better in the long run to use post date or custom taxonomy to sort/separate posts by year?
- Create posts inside CPT post
- wp delete duplicate entries of custom post types every 15 minutes
- How do I link to a dynamic ACF button from a Custom Post type?
- Show Post columns to specific users on condition
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- How to use costum database table for custom post type
- How to solve performance issue caused by custom post type overview with 20k+ custom taxonomy terms
- Custom Post Type Pagination Not Working or Single Posts Displaying?
- Excerpt for each post type and for is_front_page
- Show taxonomies from specific CPT
- Custom metabox value not saving
- Category / Custom Post Type permalink issue
- Comments are not working on Custom Post Type
- Dynamically count the number of custom post types associated to a custom taxonomy