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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extending-the-rest-api/routes-and-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

*/
function prefix_data_arg_sanitize_callback( $value, $request, $param ) {
// It is as simple as returning the sanitized value.
Expand Down