[wp-trac] [WordPress Trac] #38463: WP_REST_Request allow getting a specific param value.
WordPress Trac
noreply at wordpress.org
Sun Oct 23 17:19:42 UTC 2016
#38463: WP_REST_Request allow getting a specific param value.
-------------------------------+-----------------------------
Reporter: TimothyBlynJacobs | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.4
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
It would be great if there was an easy way to get a specific parameter
value.
For example, instead of:
{{{
$url_params = $request->get_url_params();
$value = $url_params['id'];
}}}
You could do either this
{{{
$value = $request->get_url_param( 'id' );
}}}
or this
{{{
$value = $request->get_param( 'id', 'URL' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38463>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list