How can I edit the email sent when a new comment is received?

The comment_notification_text filter is in wp-includes/pluggable.php in the wp_notify_postauthor function. You can copy and paste the $notify_message stuff and edit out what you don’t want. function wpd_comment_notification_text( $notify_message, $comment_id ){ // get the current comment and post data $comment = get_comment( $comment_id ); $post = get_post( $comment->comment_post_ID ); // don’t modify trackbacks or pingbacks if( … Read more

Notify admin when page is edited?

You can register TheDeadMedic’s function to fire on the save_post action, which runs every time a post is saved, regardless of whether or not the status changed. add_action( ‘save_post’, ‘__notify_admin_on_publish’, 10, 3 ); Then, comment out these lines in his function: //if ( $new_status != ‘publish’ || $old_status == ‘publish’ ) //return; To prevent getting … Read more

Hook/notify when any option or setting is added or updated

Looking at the sources (core files, wp-includes/option.php) you can always find your target hook tags: add_action(‘added_option’, ‘wpse230212_callback_add’, 10, 2); add_action(‘updated_option’, ‘wpse230212_callback_update’, 10, 3); function wpse230212_callback_add( $option_name, $option_value ) { // do stuff on add_option } function wpse230212_callback_update( $option_name, $old_value, $option_value ) { // do stuff on update_option } Hope that helps.

Disabling pingback and trackback notifications

To disable pingback and trackbacks, add this code to your functions.php file in your child theme: add_action( ‘pre_ping’, ‘wpse_190346_internal_pingbacks’ ); add_filter( ‘wp_headers’, ‘wpse_190346_x_pingback’); add_filter( ‘bloginfo_url’, ‘wpse_190346_pingback_url’) ; add_filter( ‘bloginfo’, ‘wpse_190346_pingback_url’) ; add_filter( ‘xmlrpc_enabled’, ‘__return_false’ ); add_filter( ‘xmlrpc_methods’, ‘wpse_190346_xmlrpc_methods’ ); function wpse_190346_internal_pingbacks( &$links ) { // Disable internal pingbacks foreach ( $links as $l => $link … Read more

Disabling Comment Notifications for Post Author

I skimmed through the source of the wp_notify_postauthor() function and noticed the comment_notification_recipients filter. I wonder if you could simplify your plugin to the following code snippet: <?php /** * Plugin Name: Disable comment/trackback/pingback notifications emails * Plugin URI: http://wordpress.stackexchange.com/a/150141/26350 */ add_filter( ‘comment_notification_recipients’, ‘__return_empty_array’, PHP_INT_MAX ); add_filter( ‘comment_moderation_recipients’, ‘__return_empty_array’, PHP_INT_MAX ); where we use an … Read more

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