Skip to content

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
* @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