mirror of
https://github.com/szepeviktor/wordpress-website-lifecycle.git
synced 2025-08-17 18:11:08 +08:00
Add _core-comment MU plugin
This commit is contained in:
parent
0928ebea47
commit
6990166682
1 changed files with 21 additions and 0 deletions
21
mu-plugins/_core-comment.php
Normal file
21
mu-plugins/_core-comment.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Plugin Name: Disable comment moderation notification to admin
|
||||
* Plugin URI: https://github.com/szepeviktor/wordpress-website-lifecycle
|
||||
*/
|
||||
|
||||
add_filter(
|
||||
'comment_moderation_recipients',
|
||||
static function ($emails) {
|
||||
$admin_email = get_bloginfo('admin_email');
|
||||
return array_filter(
|
||||
$emails,
|
||||
static function ($address) use ($admin_email) {
|
||||
return $address !== $admin_email;
|
||||
}
|
||||
);
|
||||
},
|
||||
10,
|
||||
1
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue