PHP code example of mainstreamct / laravel-wp-api

1. Go to this page and download the library: Download mainstreamct/laravel-wp-api 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/ */

    

mainstreamct / laravel-wp-api example snippets


'providers' => array(
  MainstreamCT\WordPressAPI\WordPressAPIServiceProvider::class
)

'aliases' => array(
  'WordPressAPI' => MainstreamCT\WordPressAPI\Facades\WordPressAPI::class
),

WordPressAPI::getPosts($page);

WordPressAPI::getPages($page);

WordPressAPI::getPostBySlug($slug);

WordPressAPI::getPostByID($id);

WordPressAPI::getCategories();

WordPressAPI::getTags();

WordPressAPI::getPostsByCategory($slug, $page);

WordPressAPI::getPostsByAuthor($slug, $page);

WordPressAPI::getPostsByTags($tags, $page);

WordPressAPI::searchPosts($query, $page);

WordPressAPI::getPostsByDate($year, $month, $page);

WordPressAPI::deploy($site_name, $blog_title, $email, $password);