PHP code example of astronati / wordpress-api-response-parser

1. Go to this page and download the library: Download astronati/wordpress-api-response-parser 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/ */

    

astronati / wordpress-api-response-parser example snippets


use WARP\Response\ResponseParser;
...
// Obtain a Response
$apiResponse = ['id' => 123, ...] // Save the response from a Wordpress API
$response = ResponseParser::create($apiResponse, ResponseParser::CREATE_POST);
...
// Get post
$post = $response->getPost();
echo $post->getID(); // 123