Closed kadamwhite closed 7 years ago
Disabled no longer relevant for 4.7! Authenticated-only API access covered in https://developer.wordpress.org/rest-api/using-the-rest-api/frequently-asked-questions/ -- #174 should be covered in developer guidelines.
In the FAQ page we should change the rest_do_request()
code sample to add a line for setting a param. This I am sure will save a lot of people's time having to lookup how to set parameters for their internal requests.
Something like this:
$request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
$request->set_param( 'per_page', 20 );
$response = rest_do_request( $request );
I would also change:
It is not comprehensive, so if your question is not explained here it may have been answered in the WordPress support forums.
To:
If your question is not explained here it may have been answered in the WordPress support forums.
Another question I saw asked alot came up around Apache ripping out the Authorization header on CGI environments. The solution is to add:
<IfModule mod_setenvif>
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</IfModule>
To a configuration file or .htaccess for Apache.
Moved those to the FAQ page, thanks @BE-Webdesign. Let's make a new issue for future FAQ additions.
Going to populate this issue with recent support questions from the WP-API github issues, then make a FAQ page for developers working with the API based on them.