[wp-trac] [WordPress Trac] #35069: Allow short-circuiting wp_mail

WordPress Trac noreply at wordpress.org
Thu Jan 7 02:43:38 UTC 2016


#35069: Allow short-circuiting wp_mail
--------------------------------------+------------------
 Reporter:  DvanKooten                |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  low                       |   Milestone:  4.5
Component:  Mail                      |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------

Comment (by DvanKooten):

 @johnbillion Isn't that what WP is all about? ;)

 My $.02 is that it's pretty much in line with other core functions like
 `wp_schedule_event` and how the `WP_HTTP` API works using
 `pre_http_request`. I think it makes sense for expensive operations to
 offer such a thing.

 Also, it's already possible to do this by passing the `$atts` array with
 empty values but that still runs a bunch of code to instantiate the
 `PHPMailer` object.

 That also gets us to your second question as `$atts` is treated as if an
 array after the filter runs, without any checking. This would make it easy
 to just bail on any non-array value.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35069#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list