WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 5 weeks ago

#46907 new enhancement

Pass current request object to rest_authentication_errors filter

Reported by: ocean90 Owned by:
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: REST API Keywords: has-patch
Focuses: rest-api Cc:

Description

If you hook into rest_authentication_errors and need to check the used route or method you currently have to do the same handling which WP_REST_Server::serve_request() has already done before WP_REST_Server::check_authentication() is called.
To avoid this I'm proposing to pass $request as a parameter to WP_REST_Server::check_authentication() and the rest_authentication_errors filter.

Attachments (1)

46907.diff (1.8 KB) - added by ocean90 2 months ago.

Download all attachments as: .zip

Change History (3)

@ocean90
2 months ago

This ticket was mentioned in Slack in #core-restapi by ocean90. View the logs.


2 months ago

This ticket was mentioned in Slack in #core-restapi by espellcaste. View the logs.


5 weeks ago

Note: See TracTickets for help on using tickets.