Created
March 15, 2016 18:56
-
-
Save stevegrunwell/7c9c684d7389b968836e to your computer and use it in GitHub Desktop.
WP404: Send an email to Eric Mann every time there's a 404
This file contains 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 | |
/** | |
* Email the error log to Eric Mann every time a 404 error occurs. | |
* | |
* @param array $report The WP404 report. | |
* @return array The (untouched) WP404 report. | |
*/ | |
function mytheme_spam_eric_with_404s( $report ) { | |
wp_mail( | |
'ericmann@example.com', | |
__( 'New 404 error', 'my-theme-text-domain' ), | |
print_r( $report, true ) | |
); | |
return $report; | |
} | |
add_filter( 'wp404_report_data', 'mytheme_spam_eric_with_404s', 999999999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment