Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('cmb2_init', 'omni_central_metabox');
- function omni_central_metabox() {
- $prefix = '_omni_';
- // Anexos do Portfolio
- $portfolioAnexos = new_cmb2_box(array(
- 'id' => 'portfolio-anexos',
- 'title' => 'Anexos',
- 'object_types' => array('central-conhecimento'),
- 'context' => 'normal',
- 'priority' => 'high',
- 'closed' => true,
- ));
- $group_field_id = $portfolioAnexos->add_field(array(
- 'id' => 'portfolio_anexos_repeat',
- 'type' => 'group',
- 'description' => __('Anexos do portfólio', 'omni'),
- 'options' => array(
- 'group_title' => __('Grupo {#}', 'omni'),
- 'add_button' => __('Novo Grupo', 'omni'),
- 'remove_button' => __('Remover Grupo', 'omni'),
- 'sortable' => true,
- ),
- ));
- $portfolioAnexos->add_group_field($group_field_id, array(
- 'name' => 'Título do Grupo de Anexos',
- 'id' => $prefix . 'grupo_anexo_title',
- 'type' => 'text',
- ));
- $portfolioAnexos->add_group_field($group_field_id, array(
- 'name' => 'Enviar Anexos',
- 'desc' => '',
- 'id' => $prefix . 'portfolio_attachment_list',
- 'type' => 'file_list',
- 'options' => array(
- 'add_upload_files_text' => 'Adicionar',
- 'remove_image_text' => 'Remover',
- 'file_text' => 'Anexo',
- 'file_download_text' => 'Download',
- 'remove_text' => 'Remover',
- ),
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement