Automattic / Automattic/wp-rest-php-lib
Multiple issues regarding WP_REST_Request object on a local wp 4.7
- Dominant language
- PHP
- Stars
- 17
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
First of all when I included `/src/wpcom.php` in my project the `WP_REST_Request` object was already declared by the core installation so I had to comment `//require_once( $base_dir . '/class-wp-rest-request.php' );`
Second when I tried to get a token with the `request_access_token()` I got an error related to the request method because `self::REQUEST_METHOD_POST` is passed in second position in the `WP_REST_Request` object from this repo but passed first in the core `WP_REST_Request` object. You can see the new object here:
https://developer.wordpress.org/reference/classes/wp_rest_request/
Third in order to make the script work I renamed every classes with the prefix WP_REST_ by WP_API_REST_ to avoid conflicts with the core objects but Im not sure this is a suitable solution.
Fourth I also add to replace `WP_Rest_Client` by my new work around object name `WP_API_REST_Client` in `abstract class WP_API_REST_Object`
What do you suggest to do to connect the wordpress.com API with the new core integration of the REST API?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.