Skip to content

Instantly share code, notes, and snippets.

@stevegrunwell
Created March 15, 2016 18:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevegrunwell/7c9c684d7389b968836e to your computer and use it in GitHub Desktop.
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
<?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