Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: l3rady's CPT Structure Helper
Plugin URI: http://l3rady.com/projects/l3rady-cpt-structure-helper/
Description:
Author: Scott Cariss
Version: 0.2.1
Author URI: http://l3rady.com/
Text Domain: sccptshelper
Domain Path: /languages
<?php
function cmb_opt_groups( $args, $defaults, $field_object, $field_types_object ) {
// Only do this for the field we want (vs all select fields)
if ( '_cmb_option_field' != $field_types_object->_id() ) {
return $args;
}
$option_array = array(
'Group 1' => array(