[wp-trac] [WordPress Trac] #46907: Pass current request object to rest_authentication_errors filter
WordPress Trac
noreply at wordpress.org
Fri Mar 4 05:50:48 UTC 2022
#46907: Pass current request object to rest_authentication_errors filter
-------------------------+-----------------------
Reporter: ocean90 | Owner: ocean90
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: REST API | Version:
Severity: normal | Resolution: wontfix
Keywords: needs-patch | Focuses: rest-api
-------------------------+-----------------------
Comment (by kakomap):
Hi here,
I've followed this and I'd like to add a use-case where the `$request`
might be useful. A plugin might, like in my case, want to have the REST
API restricted for all API requests except some particular endpoints.
The plugin needs to hook into `rest_authentication_errors` but needs to
return `WP_Error|null|true` based on the request being processed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46907#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list