PHP code example of brightoak / wordpress-tools

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

    

brightoak / wordpress-tools example snippets

 php
add_action('init', function(){
    CustomPostType::init('example')->setSupports('title', 'editor')->register();
});
 php
add_action('init', function(){
    CustomPostType::init('book')
    ->setOptions('description' => 'Description', 'has_archive' => true])
    ->setSupports('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments')
    ->register();
});