[wp-trac] [WordPress Trac] #34647: Don't return route URL in WP_REST_Request:get_params()
WordPress Trac
noreply at wordpress.org
Tue Nov 10 14:13:57 UTC 2015
#34647: Don't return route URL in WP_REST_Request:get_params()
-----------------------------+------------------
Reporter: danielbachhuber | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.4
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-----------------------------+------------------
Description changed by danielbachhuber:
Old description:
> Originally reported in https://github.com/WP-API/WP-API/issues/1621
New description:
Not sure if this was intended, but it's annoying me. In my callback, where
`$request` is `WP_REST_Request` object and I do this:
{{{
$params = $request->get_params();
$zero = $request->get_param( 0 );
}}}
I get a 0 index in `$params` and `$zero` has the route URL. I don't see
why it ''should'' be a param, it's not registered on the endpoint, and its
redundant to what I can get with the `get_url_params()` method.
Originally reported in https://github.com/WP-API/WP-API/issues/1621
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34647#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list