Skip to content

Instantly share code, notes, and snippets.

@tripflex
tripflex / functions.php
Last active January 19, 2023 16:02
How to add additional email addresses when email is sent to WordPress admin_email option value
<?php
/**
*
* WARNING: this only checks if the email is being sent to the same email as admin_email option.
* If for some reason another email is sent to that same email address, but it's not meant as an "admin email"
* this filter will still add those additional emails, just something to keep in mind.
*/
add_filter( 'wp_mail', 'my_custom_to_admin_emails' );