PHP code example of vivlong / phalapi-wordpress

1. Go to this page and download the library: Download vivlong/phalapi-wordpress 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/ */

    

vivlong / phalapi-wordpress example snippets


    'Wordpress' => array(
        'url' => '<yourSiteUrl>',
        'api_key' => '<userApiKey>',
        'api_secret' => '<userApiSecret>',
        'options' => [
            'version' => 'wp/v2',
            'verify_ssl' => false,
            'timeout' => 10,
        ],
        'auth' => 'jwt',
        'jwt_token' => '<JwtToken>',
        'basic_user' => '<username>',
        'basic_pwd' => '<password>',
    ),

$wordpress = new \PhalApi\Wordpress\Lite();