PHP code example of wpessential / wpessential-postypes

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

    

wpessential / wpessential-postypes example snippets


$name = 'YOUR_POST_TYPE_NAME';
$cpt = \WPEssential\Library\Cpt::make($name);
$cpt->register();

$name = 'YOUR_POST_TYPE_NAME';
$cpt = \WPEssential\Library\Cpt::make($name);
$cpt->remove();

$post_type = 'YOUR_POST_TYPE_SLUG';
$name = 'YOUR_TAXONOMY_NAME';
$ctxm = \WPEssential\Library\Ctxm::make($post_type, $name);
$ctxm->register();

$post_type = 'YOUR_POST_TYPE_SLUG';
$name = 'YOUR_TAXONOMY_NAME';
$ctxm = \WPEssential\Library\Ctxm::make($post_type, $name);
$ctxm->remove();