$prefixHide . 'event', 'title' => 'Ausbildung', 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'cmb_styles' => true, // false to disable the CMB stylesheet 'closed' => true, // Keep the metabox closed by default //'show_on' => array( 'key' => 'page-template', 'value' => 'vita.php' ), ) ); $group_field_schools = $event->add_field( array( 'id' => 'school-events', 'type' => 'group', // 'description' => __( 'Generates reusable form entries', 'cmb2' ), 'repeatable' => true, // use false if you want non-repeatable group 'options' => array( 'group_title' => __( 'Termin {#}', 'cmb2' ), // since version 1.1.4, {#} gets replaced by row number 'add_button' => __( 'Add Another Entry', 'cmb2' ), 'remove_button' => __( 'Remove Entry', 'cmb2' ), 'sortable' => true, // beta 'closed' => true, // true to have the groups closed by default ), ) ); // Regular text field $event->add_group_field( $group_field_schools, array( 'name' => __( 'Typ', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'type', 'type' => 'select', 'options' => array( 'Work Theater' => __( 'Theater', 'cmb2' ), 'Work Shows' => __( 'Show', 'cmb2' ), 'Work Film' => __( 'Film/Werbung', 'cmb2' ), ), 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // Regular text field $event->add_group_field( $group_field_schools, array( 'name' => __( 'Datum', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'date', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // Regular text field $event->add_group_field( $group_field_schools, array( 'name' => __( 'Name des Stücks', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'name', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // URL text field $event->add_group_field( $group_field_schools, array( 'name' => __( 'Arbeit', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'work', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // Regular text field $event->add_group_field( $group_field_schools, array( 'name' => __( 'Zusatz', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'addon', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); } add_filter('cmb2_admin_init', 'metaBoxes_assistantships'); function metaBoxes_assistantships() { $prefixHide = '_ankr-cmb-assist_'; $event = new_cmb2_box( array( 'id' => $prefixHide . 'event', 'title' => 'Assistenzen', 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'cmb_styles' => true, // false to disable the CMB stylesheet 'closed' => true, // Keep the metabox closed by default //'show_on' => array( 'key' => 'page-template', 'value' => 'vita.php' ), ) ); $group_field_assistantships = $event->add_field( array( 'id' => 'assist-events', 'type' => 'group', // 'description' => __( 'Generates reusable form entries', 'cmb2' ), 'repeatable' => true, // use false if you want non-repeatable group 'options' => array( 'group_title' => __( 'Termin {#}', 'cmb2' ), // since version 1.1.4, {#} gets replaced by row number 'add_button' => __( 'Add Another Entry', 'cmb2' ), 'remove_button' => __( 'Remove Entry', 'cmb2' ), 'sortable' => true, // beta 'closed' => true, // true to have the groups closed by default ), ) ); // Regular text field $event->add_group_field( $group_field_assistantships, array( 'name' => __( 'Datum', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'date', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // Regular text field $event->add_group_field( $group_field_assistantships, array( 'name' => __( 'Name des Stücks', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'name', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // URL text field $event->add_group_field( $group_field_assistantships, array( 'name' => __( 'Arbeit', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'work', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // Regular text field $event->add_group_field( $group_field_assistantships, array( 'name' => __( 'Zusatz', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'addon', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); } add_filter('cmb2_admin_init', 'metaBoxes_work'); function metaBoxes_work() { $prefixHide = '_ankr-cmb_'; /*$prefixShow = 'cmb2_';*/ $event = new_cmb2_box( array( 'id' => $prefixHide . 'event', 'title' => 'Arbeiten', 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'cmb_styles' => true, // false to disable the CMB stylesheet 'closed' => true, // Keep the metabox closed by default //'show_on' => array( 'key' => 'page-template', 'value' => 'vita.php' ), ) ); $group_field_work = $event->add_field( array( 'id' => 'work-events', 'type' => 'group', // 'description' => __( 'Generates reusable form entries', 'cmb2' ), 'repeatable' => true, // use false if you want non-repeatable group 'options' => array( 'group_title' => __( 'Termin {#}', 'cmb2' ), // since version 1.1.4, {#} gets replaced by row number 'add_button' => __( 'Add Another Entry', 'cmb2' ), 'remove_button' => __( 'Remove Entry', 'cmb2' ), 'sortable' => true, // beta 'closed' => true, // true to have the groups closed by default ), ) ); // Regular text field $event->add_group_field( $group_field_work, array( 'name' => __( 'Typ', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'type', 'type' => 'select', 'options' => array( 'Theater' => __( 'Theater', 'cmb2' ), 'Show' => __( 'Show', 'cmb2' ), 'Film' => __( 'Film/Werbung', 'cmb2' ), ), 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // Regular text field $event->add_group_field( $group_field_work, array( 'name' => __( 'Datum', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'date', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // Regular text field $event->add_group_field( $group_field_work, array( 'name' => __( 'Name des Stücks', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'name', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // URL text field $event->add_group_field( $group_field_work, array( 'name' => __( 'Arbeit', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'work', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); // Regular text field $event->add_group_field( $group_field_work, array( 'name' => __( 'Zusatz', 'cmb2' ), // 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefixHide . 'addon', 'type' => 'text', 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value ) ); } function yourprefix_add_js_for_repeatable_titles_to_footer() { ?>