sanitize_email
Filters a sanitized email address.
This filter is evaluated under several contexts, including 'email_too_short', 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits', 'domain_no_periods', 'domain_no_valid_subs', or no context.
Использование
add_filter( 'sanitize_email', 'wp_kama_sanitize_email_filter', 10, 3 ); /** * Function for `sanitize_email` filter-hook. * * @param string $sanitized_email The sanitized email address. * @param string $email The email address, as provided to sanitize_email(). * @param string|null $message A message to pass to the user. null if email is sanitized. * * @return string */ function wp_kama_sanitize_email_filter( $sanitized_email, $email, $message ){ // filter... return $sanitized_email; }
- $sanitized_email(строка)
- The sanitized email address.
- $email(строка)
- The email address, as provided to sanitize_email().
- $message(строка|null)
- A message to pass to the user. null if email is sanitized.
Список изменений
С версии 2.8.0 | Введена. |
Где вызывается хук
sanitize_email
wp-includes/formatting.php 3767
return apply_filters( 'sanitize_email', '', $email, 'email_too_short' );
wp-includes/formatting.php 3773
return apply_filters( 'sanitize_email', '', $email, 'email_no_at' );
wp-includes/formatting.php 3786
return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );
wp-includes/formatting.php 3796
return apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' );
wp-includes/formatting.php 3803
return apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );
wp-includes/formatting.php 3812
return apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );
wp-includes/formatting.php 3835
return apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );
wp-includes/formatting.php 3846
return apply_filters( 'sanitize_email', $sanitized_email, $email, null );