You should be able to change publish_post
to publish_sms
then remove any conditional logic. This is due to the following hook:
https://developer.wordpress.org/reference/hooks/new_status_post-post_type/
This is a bit of an aside, but I’m making the assumption you’ve defined your post type key as sms
(all lowercase) if not then you may need to use publish_SMS
but it’s generally best practice to use lowercase keys.
Related Posts:
- Custom Post Type causes Page Not Found
- How to use template_include hook with form submission?
- What hook can I use to modify custom post data before it is displayed on the page?
- Error in Fetching Custom Post Type parent Category URL (slug)
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- save_post hook partly firing in update post
- Tips for using WordPress as a CMS? [closed]
- Custom Post Type Templates from Plugin Folder?
- Registering Class methods as hook callbacks
- How to customize woocommerce related products? [closed]
- How to Remove Certain Screen Options and Meta Boxes from add/edit post type?
- Why does wp_enqueue_style() in plugin not load stylesheet?
- Edit plugin without hooks in functions.php
- How can I log a user out of WordPress before the page loads?
- Seeking clarification on page request life-cycle
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- Hook (upgrader_process_complete) running moment
- remove custom taxonomy metabox form custom post type
- Custom Post Type Statuses
- add_meta_box Callback not being called
- Star rating for custom post types [closed]
- How to Make a Custom Grid View
- plugin_action_links_{$plugin_file} hook not in the main plugin file
- Get image URL from media library in input
- Way to hook into a sidebar call to replace it with a custom sidebar
- How to add rewrite rules and pagination to retrieve attachments files?
- What are ideal hooks to call register_sidebars?
- AddFilter option_active_plugins is executed 6 times. Why?
- Hook to generate a dynamic sitemap with “All in One SEO Pack” Plugin
- Deactivate Plugin on Theme Switch
- how do i remove posts from a WP_Query so the pagination is right?
- How to pull code snippet from functionality plugin?
- Plugin custom post type – Internal server Error
- Is it possible to create Custom Post plug-in?
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- How to make a proper custom post type link
- Adding sections in the ‘Pages’ post type
- Matching Chapters to a Custom posts [closed]
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- Filtering WooCommerce Orders by Category
- do_action() hook into load-(page)
- Mq translate plugin custom post type issue
- Howto check version of another plugin and then add a submenu page to it
- What is the best way for showing a grid of customer logos?
- post_parent in custom post type
- Turning on output buffering in a wordpress plugin
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- wp_trash_post hook – problem with page updating if using wp_die
- is it possible to hook every page style?
- Add action to custom Function
- Price comparison table based on Custom Post Type?
- How can I list custom post type categories of portfolio
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- “Allowed memory size” problem [closed]
- Prevent plug-in scripts on a specific template?
- using wp_footer hook in a plugin
- “After file loaded” action
- Plugin Hook When New Author Added
- Custom Post Type, Custom Columns List
- need click to clipboard button on my site
- Setting Author on CPT
- Custom Post Type same name as Category
- WordPress Custom Hook with Class method
- Fail on admin_enqueue_scripts when I try it to upload a CSS file to my WordPress Plugin
- Adding category base to url in custom post giving 404?
- How to display the custom post related blog by category?
- Alternative Hook to the_content for Changing Background Color
- Undefined index: custom_post_template_present
- Unpublished Pages Failing To Appear On Custom Path
- add a hook of Woocommerce to a plugin but it only shows and doesn’t function properly
- Problem with checked box on wp car manager plugin
- Hooking into the HTML header container
- Hide WordPress Site URL from Source Code
- Plugin function in child theme
- Edit plugin’s HTML output with Hooks
- {status}_{post_type} does not run correctly?
- Identify if the_post hook is being called from the admin post list
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- WordPress hook source
- do action inside a class is not working
- How to `remove_action` from plugin
- Array to string conversion error when trying to POST multidimensional array
- Creating themes using the one Plugin (Toolkit)
- Plugin Hook: Get posts
- How to add jquery to my custom post type wp plugin
- WordPress list child pages of custom post type
- Transition Post status not working
- making a glossary with wordpress
- functions.php conditional output for a single plugin
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- OOP Plugin: Where should I place the action hooks in the class?
- How to add post type in masonry posts elementory widget
- Display Custom Post Type and Custom Taxonomy Data on Front End Using Only a Plugin
- WordPress show different custom post type
- Filter custom post type returned from REST api
- How to Add Extra Text In WordPress Title Before Post Publish
- Wrong block appender button showing
- Select posts from list and add them in a new list
- Failed to update a post when I add a taxonomy to it