1. Go to this page and download the library: Download mrldavies/wp-rest-fluent 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/ */
add_action('plugins_loaded', function () {
Rest::registerRoutes();
});
namespace App\Providers;
use Roots\Acorn\Sage\SageServiceProvider;
use Mrldavies\WpRestFluent\Rest;
class ThemeServiceProvider extends SageServiceProvider
{
public function register()
{
Rest::registerRoutes();
parent::register();
}
public function boot()
{
parent::boot();
}
}