You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm extending the built-in WP_REST_Posts_Controller class to provide extra collection parameters / WP_Query arguments (sort by meta field, filter by P2P connected posts, etc.) for a custom post type endpoint.
AFAICT there is no way to do this without duplicating all of the code in WP_REST_Posts_Controller::get_items() as I need the current WP_REST_Request object to add the appropriate query arguments.
Use case:
I'm extending the built-in
WP_REST_Posts_Controllerclass to provide extra collection parameters /WP_Queryarguments (sort by meta field, filter by P2P connected posts, etc.) for a custom post type endpoint.AFAICT there is no way to do this without duplicating all of the code in
WP_REST_Posts_Controller::get_items()as I need the currentWP_REST_Requestobject to add the appropriate query arguments.