[wp-trac] [WordPress Trac] #50876: REST API: Extract get_endpoint_args_for_item_schema to standalone function
WordPress Trac
noreply at wordpress.org
Fri Aug 7 20:27:35 UTC 2020
#50876: REST API: Extract get_endpoint_args_for_item_schema to standalone function
-------------------------+-------------------------------------------------
Reporter: | Owner: (none)
TimothyBlynJacobs |
Type: enhancement | Status: new
Priority: normal | Milestone: 5.6
Component: REST API | Version: 4.7
Severity: normal | Keywords: needs-patch needs-unit-tests good-
Focuses: | first-bug
-------------------------+-------------------------------------------------
The `WP_REST_Controller:get_endpoint_args_for_item_schema()` method allows
converting a schema to an args format for `WP_REST_Request`. This is a
helpful function for whenever you want to apply this kind of conversion,
but since it is a part of the `WP_REST_Controller` class, and doesn't
accept the schema to transform directly, doing this conversion is tricky.
I think it'd be helpful to extract this to a standalone
`rest_get_endpoint_args_for_schema( $schema, $method )` function that the
existing method in `WP_REST_Controller` can then call.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50876>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list