Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$wp = new GuzzleHttp\Client();
$request = $wp->get('http://www.example.com/wp-json/wp/v2/users');
$statusCode = $request->getStatusCode();
if($statusCode >= 200 && $statusCode < 300 ) {
$users = json_decode($request->getBody());
foreach($users as $user) {
//var_dump($user->id);
//var_dump($user->name);
//var_dump($user->slug);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.