PHP code example of jtsternberg / cmb2-term-select

1. Go to this page and download the library: Download jtsternberg/cmb2-term-select 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/ */

    

jtsternberg / cmb2-term-select example snippets


$cmb->add_field( array(
	'name'     => 'Select Category',
	'id'       => 'category_data',
	'desc'     => 'Type the name of the term and select from the options',
	'type'     => 'term_select',
	'taxonomy' => 'category',
	// 'apply_term' => false, // If set to false, saves the term to meta instead of setting term on the object.
	// 'attributes' => array(
	// 	'data-min-length' => 2, // Override minimum length
	// 	'data-delay'      => 100, // Override delay
	// ),
) );