PHP code example of reactmore / wordpress-rest-api-client
1. Go to this page and download the library: Download reactmore/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/ */
reactmore / wordpress-rest-api-client example snippets
$client = new Reactmore\WordpressClient\Wordpress(new Reactmore\WordpressClient\Request\GuzzleAdapter(new GuzzleHttp\Client()), 'http://domain.com');
// iF WP API DISABLE YOU NEED TO PASS AUTH
// $client->setCredentials(new Reactmore\WordpressClient\Auth\WpBasicAuth('user', 'password'));
// Argument 1 id default Null
// Argumend 2 Array default Null
$posts = $client->posts()->get(1, ['params' => 'Key']);
echo '<pre>';
print_r($posts);
echo '</pre>';