PHP code example of webdevstudios / wds-wp-rest-api-connect-ui

1. Go to this page and download the library: Download webdevstudios/wds-wp-rest-api-connect-ui 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/ */

    

webdevstudios / wds-wp-rest-api-connect-ui example snippets


// Get API object
$api = apply_filters( 'wds_rest_connect_ui_api_object', false );

// If WP_Error, find out what happened.
if ( is_wp_error( $api ) ) {
	echo '<xmp>'. print_r( $api->get_error_message(), true ) .'</xmp>';
}

// If a WDS_WP_REST_API\OAuth1\Connect object is returned, you're good to go.
if ( is_a( $api, 'WDS_WP_REST_API\OAuth1\Connect' ) ) {

	$schema = $api->get_api_description();

	// Let's take a look at the API schema
	echo '<xmp>$schema: '. print_r( $schema, true ) .'</xmp>';
}