WordPress.org

Make WordPress Core

Ticket #18926: pluggable.php.2.diff

File pluggable.php.2.diff, 426 bytes (added by soulseekah, 6 years ago)

using a filter with WP_Error

  • wp-includes/pluggable.php

     
    433433        try {
    434434                $phpmailer->Send();
    435435        } catch ( phpmailerException $e ) {
    436                 return false;
     436                return apply_filters( 'wp_mail_send_failed', false, new WP_Error( $e->getCode(), $e->getMessage() ) );
    437437        }
    438438
    439439        return true;