Created
May 21, 2025 14:01
-
-
Save luizbills/e3081ec1c537fd185d021b43511985b8 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