[wp-trac] [WordPress Trac] #35069: Allow short-circuiting wp_mail
WordPress Trac
noreply at wordpress.org
Mon Dec 14 09:45:54 UTC 2015
#35069: Allow short-circuiting wp_mail
----------------------------------------+--------------------------
Reporter: DvanKooten | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.5
Component: Mail | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses: performance
----------------------------------------+--------------------------
Comment (by DvanKooten):
What about checking if the returned filter value is an array (which it
expects right now) and if it is, proceeding with the function as it
stands. If it's not an array, return early using the return value of the
filter.
{{{#!php
if( ! is_array( $atts ) ) {
return $atts;
}
}}}
The process could be reversed by checking for a boolean, but as the rest
of the function uses the value as if it's an array now anyway I think that
would make less sense.
That would be pretty much in line with what the other short-circuited
functions do as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35069#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list