PHP code example of zao-web / wp-api-connect-ui
1. Go to this page and download the library: Download zao-web/wp-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/ */
zao-web / wp-api-connect-ui example snippets
// Get API object
$api = apply_filters( 'wp_api_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 Zao\WP_API\OAuth1\Connect object is returned, you're good to go.
if ( is_a( $api, 'Zao\WP_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>';
}