@@ 903-913 (lines=11) @@ | ||
900 | * @param string $param |
|
901 | * @return mixed |
|
902 | */ |
|
903 | function rest_parse_request_arg( $value, $request, $param ) { |
|
904 | $is_valid = rest_validate_request_arg( $value, $request, $param ); |
|
905 | ||
906 | if ( is_wp_error( $is_valid ) ) { |
|
907 | return $is_valid; |
|
908 | } |
|
909 | ||
910 | $value = rest_sanitize_request_arg( $value, $request, $param ); |
|
911 | ||
912 | return $value; |
|
913 | } |
|
914 | ||
915 | /** |
|
916 | * Determines if an IP address is valid. |
@@ 1629-1641 (lines=13) @@ | ||
1626 | * @return WP_Error|string The sanitized email address, if valid, |
|
1627 | * otherwise an error. |
|
1628 | */ |
|
1629 | public function check_comment_author_email( $value, $request, $param ) { |
|
1630 | $email = (string) $value; |
|
1631 | if ( empty( $email ) ) { |
|
1632 | return $email; |
|
1633 | } |
|
1634 | ||
1635 | $check_email = rest_validate_request_arg( $email, $request, $param ); |
|
1636 | if ( is_wp_error( $check_email ) ) { |
|
1637 | return $check_email; |
|
1638 | } |
|
1639 | ||
1640 | return $email; |
|
1641 | } |
|
1642 | } |
|
1643 |