false ) ); if ( !$menus ) { echo '

'. sprintf( __('No menus have been created yet. Create some.'), admin_url('nav-menus.php') ) .'

'; return; } echo ''; echo '

', $field['desc'], '

'; } /** * Add filter to make the newly defined custom_menu meta field work with CMB for WP * forked from Travis Northcutt's gist: https://gist.github.com/2284508 * @author Pat Ramsey * * 'type' is set to the latter part of the cmb_render_ action created above. In this case 'custom_menu' * */ add_filter( 'cmb_meta_boxes', 's25_menu_meta_boxes' ); function s25_menu_meta_boxes( $meta_boxes ) { $meta_boxes[] = array ( 'id' => 's25_menu_box', 'title' => 'Custom Menu', 'pages' => array ( 'page' ), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, // Show field names on the left 'fields' => array ( array ( 'name' => 'Custom Menu', 'id' => 's25_custom_menu', 'type' => 'custom_menu', 'desc' => 'Invalid email addresses will be wiped out.' ) ) ); return $meta_boxes; }