[wp-trac] [WordPress Trac] #47793: Incorrect filter documentation in is_email() function
WordPress Trac
noreply at wordpress.org
Mon Jul 29 12:02:48 UTC 2019
#47793: Incorrect filter documentation in is_email() function
--------------------------+-----------------------------
Reporter: jenkoian | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: trunk
Severity: normal | Keywords: has-patch
Focuses: docs |
--------------------------+-----------------------------
The docs for the {{{is_email()}}} filter are slightly incorrect:
{{{
/**
* Filters whether an email address is valid.
*
* This filter is evaluated under several different
contexts, such as 'email_too_short',
* 'email_no_at', 'local_invalid_chars',
'domain_period_sequence', 'domain_period_limits',
* 'domain_no_periods', 'sub_hyphen_limits',
'sub_invalid_chars', or no specific context.
*
* @since 2.8.0
*
* @param bool $is_email Whether the email address has
passed the is_email() checks. Default false.
* @param string $email The email address being
checked.
* @param string $context Context under which the email
was tested.
*/
}}}
https://github.com/WordPress/WordPress/blob/c7493264a41addda75c05e49d65e8cc2bbbeaf44
/wp-includes/formatting.php#L3279-L3291
Suggests that {{{$is_email}}} will always be a boolean, but as you can see
from the following it could be a string:
{{{return apply_filters( 'is_email', $email, $email, null );}}}
https://github.com/WordPress/WordPress/blob/c7493264a41addda75c05e49d65e8cc2bbbeaf44
/wp-includes/formatting.php#L3350
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47793>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list