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

Add permission_callback to Route Registration #69

Open
amberjones opened this issue Aug 4, 2022 · 0 comments
Open

Add permission_callback to Route Registration #69

amberjones opened this issue Aug 4, 2022 · 0 comments

Comments

@amberjones
Copy link

As of WordPress 5.5, if a permission_callback is not provided, the REST API will issue a _doing_it_wrong notice.

This is a function that checks if the user can perform the action (reading, updating, etc) before the real callback is called. This allows the API to tell the client what actions they can perform on a given URL without needing to attempt the request first.

For REST API routes that are intended to be public, use __return_true as the permission callback

There are two places to add the permissions callback:
The /access_token route.
The /authorize route.

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

No branches or pull requests

1 participant