Created
March 1, 2018 23:20
-
-
Save ulaulaman/5facc808d12857c18b075eb8fedbc1c5 to your computer and use it in GitHub Desktop.
Group field defined with cmb2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'cmb2_init', 'cmb2_add_metabox_didattica' ); | |
function cmb2_add_metabox_didattica() { | |
$prefix = '_eduinaf_'; | |
$curriculum_scolastico = $cmb->add_field( array( | |
'name' => __( 'Curriculum scolastico', 'eduinaf' ), | |
'id' => $prefix . 'curriculum_scolastico', | |
'type' => 'group', | |
'desc' => __( 'Cliccare su "Add Group" per aggiungere un nuovo gruppo di campi', 'eduinaf' ), | |
'options' => array( | |
'group_title' => __( 'Livello, materia, argomento', 'eduinaf' ), | |
'add_button' => __( 'Aggiungi un\'altra materia', 'eduinaf' ), | |
'remove_button' => __( 'Rimuovi', 'eduinaf' ), | |
'sortable' => true | |
) | |
) ); | |
$cmb->add_group_field( $curriculum_scolastico, array( | |
'name' => __( 'Livello scolastico', 'eduinaf' ), | |
'id' => $prefix . 'curriculum_scolastico_livello_scolastico', | |
'type' => 'text', | |
) ); | |
$cmb->add_group_field( $curriculum_scolastico, array( | |
'name' => __( 'Materia', 'eduinaf' ), | |
'id' => $prefix . 'curriculum_scolastico_materia', | |
'type' => 'text', | |
) ); | |
$cmb->add_group_field( $curriculum_scolastico, array( | |
'name' => __( 'Certificazione', 'eduinaf' ), | |
'id' => $prefix . 'curriculum_scolastico_certificazione', | |
'type' => 'text', | |
) ); | |
$cmb->add_group_field( $curriculum_scolastico, array( | |
'name' => __( 'Argomento', 'eduinaf' ), | |
'id' => $prefix . 'curriculum_scolastico_argomento', | |
'type' => 'text', | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment