Skip to content

Instantly share code, notes, and snippets.

@kodie
Created September 9, 2020 19:19
Show Gist options
  • Save kodie/b9c00a65bbd52c5790d5bcea3ba62c5c to your computer and use it in GitHub Desktop.
Save kodie/b9c00a65bbd52c5790d5bcea3ba62c5c to your computer and use it in GitHub Desktop.
Stops any emails from sending and instead prints the email message out on the page in WordPress
<?php
// Stops any emails from sending and instead prints the email message out on the page
add_filter('wp_mail', 'preview_emails', 1, 99);
function preview_emails($args) {
echo $args['message'];
die();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment