$prefix . 'upstudy_lp_course_metabox', 'title' => __('Course Options', 'upstudy'), 'object_types' => array('lp_course'), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => true, // Show field names on the left )); $cmb_lp_course_metabox->add_field(array( 'name' => 'Add Intro Video URL', 'id' => 'upstudy_lp_video', 'type' => 'oembed', )); $cmb_lp_course_metabox->add_field( array( 'name' => __( 'Header Image', 'upstudy' ), 'id' => $prefix . 'header_img', 'type' => 'file', 'options' => array( 'url' => false ), 'text' => array( 'add_upload_file_text' => __( 'Add Image', 'upstudy' ) ), 'description' => __( 'This image will be shown at the course single page header section.', 'upstudy' ) ) ); } // ========= LearnPress course custom features metxbox ======== add_action('cmb2_admin_init', 'tpc_upstudy_lp_course_feature_metaboxes'); function tpc_upstudy_lp_course_feature_metaboxes() { $prefix = '_upstudy_'; $cmb = new_cmb2_box(array( 'id' => 'upstudy_lp_course_feature_repeater', // Belgrove Bouncing Castles 'title' => 'Custom Course Features', 'object_types' => array('lp_course'), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => true, // Show field names on the left )); $lp_custom_feature_group_id = $cmb->add_field(array( 'id' => 'lp_custom_feature_group', 'type' => 'group', 'repeatable' => true, 'options' => array( 'group_title' => 'Course Features {#}', 'add_button' => 'Add Another Feature', 'remove_button' => 'Remove Feature', 'closed' => true, // Repeater fields closed by default - neat & compact. 'sortable' => true, // Allow changing the order of repeated groups. ), )); $cmb->add_group_field($lp_custom_feature_group_id, array( 'name' => __('Add Icon', 'upstudy'), 'desc' => __('Here you can add icon classes such as Dashicon, Elementor, etc. Learn more about the icons class. go here', 'upstudy'), 'id' => 'lp_custom_feature_group_icon', 'type' => 'text', // This field type )); $cmb->add_group_field($lp_custom_feature_group_id, array( 'name' => __('Label', 'upstudy'), 'desc' => __('Add your custom course feature label', 'upstudy'), 'id' => 'lp_custom_feature_group_label', 'type' => 'text', )); $cmb->add_group_field($lp_custom_feature_group_id, array( 'name' => __('Value', 'upstudy'), 'desc' => __('Add your custom course feature label value', 'upstudy'), 'id' => 'lp_custom_feature_group_value', 'type' => 'text', )); }