PHP code example of nsrosenqvist / cmb2-post-types

1. Go to this page and download the library: Download nsrosenqvist/cmb2-post-types 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/ */

    

nsrosenqvist / cmb2-post-types example snippets


$list = new_cmb2_box(array(
    'id'            => 'list',
    'title'         => __('List', 'theme'),
));

$post_types = $list->add_field(array(
    'name' => __( 'Post Types Included In List', 'theme'),
    'id'   => 'post_types',
    'type'    => 'multicheck_post_type',
    'default' => ['page', 'post'],
));