Add utility for WPCOM API requests as user#9122
Conversation
mattwiebe
left a comment
There was a problem hiding this comment.
Good work here. Works well with the new opt-out endpoint, which is now live on wpcom.
|
Nicely done. My only feedback here is to make the method more clear that we are requesting the new rest api. (WordPress.com REST API v2) Unless this method also works with the old api. (Which I have not tested) Also since there is already a method for requesting the old api as a blog it would be good if these 2 methods had the same order of arguments. vs |
- Add endpoint proxy for D11180-code - Add `Jetpack::current_user_ip()` with `$check_all_headers` param. Depends on: #9122
|
@enejb writes...
Good suggestion. Thank you. I fixed this in ddeb969 so it now matches the order of arguments to
This method currently works only with v2 of the API. However, it does support a |
|
Just noting that #9142 now depends on this PR. |
* Add tracking settings endpoint proxy w/ IP utility - Add endpoint proxy for D11180-code - Add `Jetpack::current_user_ip()` with `$check_all_headers` param. Depends on: #9122 * Fix content-type (application/json) * Match order of args to `wpcom_json_api_request_as_blog()` * Endpoint rename: `/tracking/settings`
This adds a new utility method:
Jetpack_Client::wpcom_json_api_request_as_user()Getting/Setting GDPR Settings via Jetpack
Get current settings:
Update settings: