User profile update author
wp_get_current_user used inside your hook callback should tell you who is making the edit. $editing_user = wp_get_current_user(); Without code, that is all I’ve got.
wp_get_current_user used inside your hook callback should tell you who is making the edit. $editing_user = wp_get_current_user(); Without code, that is all I’ve got.
Instead of rely on global $post, you should use the post object passed to function via the posts status transition: add_action(‘pending_to_future’, ‘scheduledNotification’); add_action(‘approved_to_future’, ‘scheduledNotification’); function scheduledNotification( $post ) { $author = get_userdata($post->post_author); // the rest of your function here }
I do not see the $comment_ID variable having any value in your code. So try by changing the following code wp_notify_postauthor($comment_ID, $comment->comment_type); to wp_notify_postauthor($comment->comment_ID, $comment->comment_type); You can also remove $comment->comment_type as per codex
Which hook to use to add notification message at beginning of my
This notification is added by your theme. You can remove the upsell notices for this theme by hooking into the ttfmake_is_plus filter: add_filter( ‘ttfmake_is_plus’, ‘__return_true’ );
Possible to hide the search engine indexing disabled prompt/error message?
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 … Read more
Wrap it in a function and hook it to transition_post_status: function wpse_18140_transition_post_status( $new, $old, $post ) { if ( $new === ‘publish’ && $new !== $old ) { // Your code here } } add_action( ‘transition_post_status’, ‘wpse_18140_transition_post_status’, 10, 3 ); This will run everytime a post is published, but not when you simply update the … Read more
with the 4th parameter of wp_mail() you can extend the header of the Email. So you can use BCC there. This should work: <?php $bcc=”Bcc: “; $i = 0; foreach( $emails as $email ){ if( $i != 0 ) $bcc .= ‘, ‘; $bcc .= $email; $i = 1; } $headers[] = $bcc; wp_mail( ‘[email protected]’, … Read more
How can I see whether a commenter has subscribed to be notified of replies / other comments to a post