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
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- Customizing subject in comment notification e-mails
- How to work with Syntax Highlighter Evolved?
- WP showing “warning: call_user_func_array()”, What to do?
- jQuery plugin only in one page/post
- How to add usermeta to “Notice of Email Change” email message
- Which hook should be used to validate custom form fields on the login form?
- Share buttons on article footer
- How to create a Page alias in WordPress
- Hook (upgrader_process_complete) running moment
- How to extract images of post and pages excluding header and logo image in wordpress?
- Dynamic HTML not displaying at respective place
- Adding dynamic section to WordPress
- woocommerce product attributes
- Filter or action hook to insert content on admin pages before tag
- plugin_action_links_{$plugin_file} hook not in the main plugin file
- wp_mail() is not working on server
- merging an array to an existing array using add_filter
- template_redirect not being called when using ajax
- Is there plugin to show recent posts from one website in the widget area of another?
- wp_mail attachment not working
- Plugin custom Action Hook not working
- Hook to generate a dynamic sitemap with “All in One SEO Pack” Plugin
- How use %like% in sql statement wordpress
- How to correctly detect accessing wp-content/uploads?
- How to get 1 or 2 specific posts on top of my wordpress blog?
- Email Bounce Address
- With W3 Total Cache when I publish a post it does not appear in the homepage. Only if i purge all cache [closed]
- Hiding posts – WP Hide Post not working
- submit posts by unregistered users in wordpress
- Any built-in function to associate a post to category through a plugin?
- Using a post-signup hook to get user details
- Trigger Elementor Popup via code [closed]
- Two problems on my WordPress installation [closed]
- Filtering WooCommerce Orders by Category
- How to pull email and name from Flamingo plugin
- Which widget to use for display category post with view more? [closed]
- How to delete all trashed item in one-go
- Implementing an “Email this” button?
- How to check if an email was sent from or originated from a specific plugin?
- Don’t publish/update a post when a plugin finds errors in custom fields
- Are there action hooks for comments?
- Collecting email addresses via a “beta” sign up form
- WooCommerce: after install hook
- Moving FB comments at the end of page
- Creating an admin meta box to save post as pending
- Custom Template for wordpress cpt plugin
- In wordpress how to sent different email separetly when i click on different email ids [closed]
- Use a hook or filter, or overwrite this Gamipress function?
- Hook from plugin doesn’t fire up from external PHP script
- WordPress – send digital product with custom email
- SMTP emails not picking up the correct From name and From email
- save_post hook partly firing in update post
- Trying to add a new feature in my wordpress website
- automatically set random featured image by category in wordpress on post
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- Use action, filter, or hook to append HTML to WordPress plugin function
- Passing function into add_action always returns the first argument
- Hook to display element as product on category page
- Is it possible to disable a theme programmatically?
- How can I get the Post ID and Post Type within a Must Use Plugin?
- plugin not hooking to my custom hook
- WordPress Dashboard organize posts based on categories
- Modify a plugin’s content
- Plugin hook breaks new WP 4.0 media library grid view?
- Setup SMTP setting in wordpress
- Related posts popup
- Find And Add Category to Posts
- Get page type to display content
- Insert data in custom table during new post creation
- Capturing POST data
- Get a submitted value from front end post form for single template
- Automatically set posts to NoIndex depending on category?
- Notification When Post Approved
- Windows 10 Printer that Sends to WordPress [closed]
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- Can’t use updated variables in handle function
- Getting 400 Error in wordpress website