PHP code example of malanciault / wordpress-rest-api-client

1. Go to this page and download the library: Download malanciault/wordpress-rest-api-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

malanciault / wordpress-rest-api-client example snippets


use Malanciault\WpApiClient\Auth\WpBasicAuth;
use Malanciault\WpApiClient\Http\GuzzleAdapter;
use Malanciault\WpApiClient\WpClient;

Auth('user', 'securepassword'));

$user = $client->users()->get(2);

print_r($user);