Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in prefix_data_arg_sanitize_callback doc on the Routes and Endpoints page #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rahmon
Copy link

@Rahmon Rahmon commented Nov 22, 2023

This PR fixes the tag @return since the return of the function prefix_data_arg_sanitize_callback is a string: return sanitize_text_field( $value );

fix typo in `prefix_data_arg_sanitize_callback` doc
@Rahmon Rahmon changed the title Fix typo in prefix_data_arg_sanitize_callback doc in Routes and Endpoints page Fix typo in prefix_data_arg_sanitize_callback doc on the Routes and Endpoints page Nov 23, 2023
@@ -516,7 +516,7 @@ function prefix_data_arg_validate_callback( $value, $request, $param ) {
* @param mixed $value Value of the 'filter' argument.
* @param WP_REST_Request $request The current request object.
* @param string $param Key of the parameter. In this case it is 'filter'.
* @return WP_Error|boolean
* @return string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch on the boolean -> string issue!

Suggested change
* @return string
* @return WP_Error|string

I do think we need to document the option to return a WP_Error: This particular function does not return one, but it is valid, and there are cases where it can be useful to return an error from a sanitizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants