-
-
Save dexit/9ddebcd07114ccbb2be23738612afb92 to your computer and use it in GitHub Desktop.
Multiple admin emails for WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Multiple administrator emails | |
* @author Luiz Bills | |
*/ | |
add_filter( 'option_admin_email', function ( $value ) { | |
global $pagenow; | |
$ignored_pages = [ 'options-general.php' ]; | |
if ( in_array( $pagenow, $ignored_pages, true ) ) { | |
return $value; | |
} | |
$list = explode( ',', $value ); | |
$list[] = '[email protected]'; | |
$list[] = '[email protected]'; | |
return implode( ',', $list ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment