Send notification to the admin when new custom post is submitted

EDIT – SOLUTION I got the solution using status ‘new_to_pending’ and adding the $auto object. function newpost_notify( $auto ) { $mailadmin = ‘[email protected]’; $subject=”Subject”; $headers=”MIME-Version: 1.0″ . “\r\n”; $headers .= ‘Content-type: text/html; charset=UTF-8’ . “\r\n”; $headers .= ‘From: xxx <[email protected]>’ . “\r\n”; $message=”There\”s a new post.’; wp_mail( $mailadmin, $subject, $message, $headers ); } add_action( ‘new_to_pending’, … Read more

How can the recipients and content for comment email notifications on a custom post type be changed?

I did it the long way, with help from a related WordPress.org support thread: add_action(‘comment_post’, ‘notify_author_of_reply’, 10, 2); function notify_author_of_reply($comment_id, $approved){ $comment = get_comment($comment_id); $post_id = $comment->comment_post_ID; $post = get_post($post_id); if($approved && (get_post_type( $post_id )==’ticket’)) { $supervisor = get_userdata( get_post_meta($post->ID, ‘assigned_by’, true) ); $operator = get_userdata( get_post_meta($post->ID, ‘assigned_to’, true) ); $client = get_userdata( $post->post_author ); … Read more

Edit Auto Update Admin Notification

Try auto_core_update_email. E.g: add_filter(‘auto_core_update_email’, function($email, $type, $core_update, $result) { if (‘success’ === $type) $email[‘body’] = sprintf( __(‘Congratulation! Your site at %1$s has been updated automatically to WordPress %2$s.’, ‘textdomain’), home_url(), $core_update->current ) . “\n\n”; return $email; }, PHP_INT_MAX, 4);

Can’t get buddypress notifications in front-end; why do I get this error?

use this: if ( !function_exists( ‘bp_core_get_notifications_for_user’ ) ) { require_once ‘/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php’; } function cg_current_user_notification_count() { $notifications = bp_core_get_notifications_for_user(bp_loggedin_user_id(), ‘object’); $count = !empty($notifications) ? count($notifications) : 0; echo $count;}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)