Skip to content

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

Open
Rahmon wants to merge 1 commit into
WP-API:masterfrom
Rahmon:patch-1
Open

Fix typo in prefix_data_arg_sanitize_callback doc on the Routes and Endpoints page#169
Rahmon wants to merge 1 commit into
WP-API:masterfrom
Rahmon:patch-1

Conversation

@Rahmon

@Rahmon Rahmon commented Nov 22, 2023

Copy link
Copy Markdown

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 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
Copy Markdown
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

2 participants