Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 25, 2022 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save searchwpgists/5f93168b6b7e443c1766353b8f23cc9d to your computer and use it in GitHub Desktop.
Save searchwpgists/5f93168b6b7e443c1766353b8f23cc9d to your computer and use it in GitHub Desktop.
Send an email to the site adminstrator when the SearchWP Index is reset.
<?php
// Send an email to the site adminstrator when the SearchWP Index is reset.
add_action( 'searchwp\index\rebuild', function() {
wp_mail(
get_option( 'admin_email' ),
'SearchWP Index Reset',
'The SearchWP Index has been reset.'
);
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment