You need to add parameters $old_status
and $new_status
to the function.
function conditional_email( $old_status, $new_status) {
wp_mail('[email protected]','test','test');
}
You will see that in the example here
Hope it works after !
Related Posts:
- How can I make it so the Add New Post page has Visibility set to Private by default?
- Disallow a user to post in certain categories
- Publish Post After Click On A Link
- How to filter content post only on save
- Action on post publish
- Easy Digital Downloads (EDD) – Purchase Receipt emails couldn’t be logged
- Is it possible to send blog posts via email to subscribers?
- WordPress: Add custom add_filter for custom functions
- how to execute some code after a post is published in WordPress [duplicate]
- trigger email when post is published by someone a user follows
- What hook can I use to modify custom post data before it is displayed on the page?
- How to write a new file when new post has been published in WordPress
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- Randomize post (and page) IDs on generation
- Show post object of any page in frontend
- Get value from an input field and pass into update_meta_data as $meta_value
- Identify if the_post hook is being called from the admin post list
- Add new post using a page inside the website
- WordPress filter that hook after each action/filter hook
- When to use action hooks and plugins
- With W3 Total Cache when I publish a post it does not appear in the homepage. Only if i purge all cache [closed]
- WordPress Registration Email by Role
- Hook (or other way) to find out when another plugin is activated / installed
- Any hook for pre-plugin-update -either bulk or single plugin update
- Is there an earlier hook than login_head or login_enqueue_scripts?
- The problem with WordPress Importer
- Add custom message to the plugins page of WordPress
- Cron job not firing
- Gravity Forms plugin: How to use “gform_editor_js” action hook? [closed]
- Solutions to repost categories into multisite blogs?
- How to enable qTranslate languages tabs in custom plugin page
- How do I “get the next 10 posts after post_id == x”?
- Hiding posts – WP Hide Post not working
- Inserting above the comment template
- Insert new user with form submit ‘init’ hook
- How do I display only the latest post on my home page, while maintaining proper plugin hooks?
- submit posts by unregistered users in wordpress
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Is there an easy way to flag posts in the admin area?
- finding whether request is for post, and post id
- Hooking in to replace the Sidebar/Widget areas
- How to get all of the activate_plugin action parameters?
- Any built-in function to associate a post to category through a plugin?
- Modifying the comments section through a plugin regardless of theme
- How to hide some section in WordPress under Post
- Display post lists in 2nd paragraph
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- Can’t delete Draft Post [closed]
- Map a custom id to wordpress post id
- Matching Chapters to a Custom posts [closed]
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- Trigger Elementor Popup via code [closed]
- wp_get_post_terms is difference obj model than the one in rest api response
- Calling plugin function inside custom plugin for onclick event
- WordPress display breadcrumbs using Yoast plugin [closed]
- Outbound link autometic converted into linkdirect , and not opening
- Get sent emails without email logs
- How to send an automated email to the customers when product is added woocommerce
- Display by Category in Admin
- get current date + 90 days and checking every day
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Looking for a way that will collect visitors emails before letting them view the blog posts [closed]
- Display encrypted content on my website
- Two problems on my WordPress installation [closed]
- Get Time Taken By Each Action Hook in WordPress
- posts comments goes to trash
- Contributive page where people logged in can write
- Sending HTML emails via wp_mail not working properly
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Filtering WooCommerce Orders by Category
- Best place for short bio,image and button [closed]
- Excerpts on category page
- How to pull email and name from Flamingo plugin
- Which widget to use for display category post with view more? [closed]
- External RSS feed to WordPress Portfolio
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- Send email when a portfolio project is updated
- do_action() hook into load-(page)
- Display wordpress post’s in popup?
- Howto check version of another plugin and then add a submenu page to it
- password_reset hook is not working
- The Hook registration_errors was not called
- Unable to add TAB character to post?
- Notify comment author upon reply
- Copy post to separate database with “add_action(….)”
- how to add text to posts from tags
- Hook into existing tinyMCE button
- Sync User to cPanel webmail?
- Add category selection to custom post type (plugin)
- How to get post ID with hooks publish_post, new_to_publish, etc
- Redirect to another page using contact form 7? [closed]
- edit_user_profile and show_user_profile are not firing inside a class
- Template filter for custom taxonomy terms
- Would Gutenberg be considered a PlugIn?
- How to pass variables to a function argument using add_action [duplicate]