Uses
| Uses | Description |
|---|---|
| wp-includes/rest-api.php: rest_validate_request_arg() | Validate a request argument based on details registered to the route. |
| wp-includes/load.php: is_wp_error() | Check whether variable is a WordPress Error. |
Checks a comment author email for validity.
Accepts either a valid email address or empty string as a valid comment author email address. Setting the comment author email to an empty string is allowed when a comment is being updated.
(string) (Required) Author email value submitted.
(WP_REST_Request) (Required) Full details about the request.
(string) (Required) The parameter name.
(string|WP_Error) The sanitized email address, if valid, otherwise an error.
File: wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
public function check_comment_author_email( $value, $request, $param ) {
$email = (string) $value;
if ( empty( $email ) ) {
return $email;
}
$check_email = rest_validate_request_arg( $email, $request, $param );
if ( is_wp_error( $check_email ) ) {
return $check_email;
}
return $email;
} | Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_comments_controller/check_comment_author_email