add_action('future_to_pending', 'send_emails_on_new_event');
add_action('new_to_pending', 'send_emails_on_new_event');
add_action('draft_to_pending', 'send_emails_on_new_event');
add_action('auto-draft_to_pending', 'send_emails_on_new_event');
/**
* Send emails on event publication
*
* @param WP_Post $post
*/
function send_emails_on_new_event($post) {
$emails = "[email protected], [email protected]"; //If you want to send to site administrator, use $emails = get_option('admin_email');
$title = wp_strip_all_tags(get_the_title($post->ID));
$url = get_permalink($post->ID);
$message = "Link to post: \n{$url}";
wp_mail($emails, "New post published: {$title}", $message);
}
Related Posts:
- How to prevent a post from being deleted?
- Limit access to posts/pages by user roles
- Enable comments for post with comments meta box removed
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Notification When Post Approved
- Notifications on WordPress Website [closed]
- Notifications Bar on home page only
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- How to Add jQuery Infinite Scroll to My Custom Archive Page
- publish_post hook isn’t working for scheduled posts
- Publish Post After Click On A Link
- Remove Adminstrator Hyperlink from a user having role to add and see users
- Edit/revise option for authors to suggest improvement to posts [closed]
- How can I change plugin to give access to editor user role?
- Is there an action that is called when a post is restored from the trash?
- wordpress custom login successful redirect hook
- plugin for wp_list_categories with posts
- Action on post publish
- Replace existing pages with new pages, keep menu links
- Adding “ ” before the last word in multiple defined areas with a plugin
- [Plugin: Posts 2 Posts] How does it work?
- How to add new tabs in post.php
- How to change ID of an attachment in wp_posts and its related tables correctly?
- New post notification plugin [closed]
- Adding Plugin-specific Fields with wp_insert_post()?
- Using the “Latest posts” feature on a different site
- Plugin to restrict access to pages in wp-admin
- Is there a way to order posts and custom post types as one group?
- How to write a plugin to add users to a mail list
- Hook to plugins admin settings
- Cron job not firing
- Is there an easy way to flag posts in the admin area?
- finding whether request is for post, and post id
- Filter custom posts based on the user role of author
- Can’t delete Draft Post [closed]
- Custom post type – no layout section of Document tab, and no author choice
- Outbound link autometic converted into linkdirect , and not opening
- Contributive page where people logged in can write
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- Display wordpress post’s in popup?
- Can a Plugin Override New User Default Role Type
- Can I allow certain people to add/edit pages within a parent?
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Recent posts per category loop?
- ‘Organize Series Plugin’ as muti author feature
- Multisite – maximum number of users with specific role
- Problem of encoding characters (apostrophes) in my posts publications
- How to backup single post in wordpress [closed]
- Allow only Admin role to access plugin settings/options page
- Is there a way to make the main page only display a brief description of the full article?
- How to change the post form from plugin?
- Allowing users to Sign-up > Login > Post articles that need approval
- How to display the featured post on the category page?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Is there a plugin or a way in the wordpress that would let us have different versions of a post or page accessibe to users?
- download button for audio file in post [closed]
- Print posts category or tag as a formatted journal
- Post deleted in trash [closed]
- How to relate 3 wordpress components with each other (Create database relationships)
- Remove specific administrator’s capability
- problem with register_activation_hook in plugin
- Creating teams of users in WordPress
- How to get Recent Post From Each Category with Thumbnail?
- What snippet do I need to type to show my ACF field show up on my theme?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Is it possible to pin a post in second position from top
- page duplication on wordpress that wont stop
- Copy/paste local images not working in WordPress
- How to change my 3000 Published post status to Draft using PHPMyAdmin
- Need help with Task assigning and rewarding as currency which withdrawable
- how to create user profile pages and display them based on users roles
- How can I see $post object in frontend from functions.php?
- Allow members to create groups on my site
- How to make this custom capability work? [duplicate]
- Public WP website with one area just for members
- All Post WordPress Page Error
- After form submission want to show success message in the form page
- Restrict role to use a plugin
- Mobile Notification on a blog post
- Is there any hook to change media html in post? [duplicate]
- How to force regenerate thumbnails in WordPress posts?
- Publish Post but don’t call publish hook in foreground post creation
- Better code/text editing for posts and pages?
- Style WordPress Custom Post Type Single Page
- SWF in wordpress post
- get post excerpt by query
- Using Postmash plugin in WordPress 3.3.1
- Want to add post to user dashboard
- Allow a role to edit one specific plugin
- Get post id in Post Page within Wp-admin
- PHP $_session is not work in wordpress
- WordPress Role Capability Restriction
- Sync roles across several plugins
- Shortcode returning specific content of a post
- Looking for membership style plugin with edit option [closed]
- Change from blogger to wordpress
- How to give access to the particular page in wordpress for specific username/email NOT roles [closed]
- Is there a plugin or another way that can help me find out the underlying files of a page/post? [closed]
- How to update a lot of posts on my WP site with additional content?
- How to have certain products show for only certain users (Not roles)