Files
2026-04-23 04:33:43 +03:30

112 lines
3.4 KiB
PHP

<?php
// WP Event Manager Meta
add_action('cmb2_admin_init', 'upstudy_tp_event_sidebar_meta');
function upstudy_tp_event_sidebar_meta()
{
$tp_event_sidebar_meta = new_cmb2_box( array(
'id' => 'upstudy_tp_event_metabox',
'title' => __( 'Event Meta', 'upstudy' ),
'object_types' => array( 'tp_event' ),
'context' => 'advanced',
'priority' => 'default',
'show_names' => true
) );
$tp_event_sidebar_meta->add_field(array(
'name' => 'Add Event Intro Video',
'id' => 'upstudy_tp_event_video',
'type' => 'oembed',
));
$tp_event_sidebar_meta->add_field( array(
'id' => 'upstudy_tp_event_extra_meta_fields',
'type' => 'group',
'name' => __( 'Event Sidebar Meta', 'upstudy' ),
'options' => array(
'group_title' => __( 'Event Meta {#}', 'upstudy' ),
'add_button' => __( 'Add Another Meta Information', 'upstudy' ),
'remove_button' => __( 'Remove Meta', 'upstudy' ),
'sortable' => true
),
'fields' => array(
array(
'name' => __( 'Meta Label', 'upstudy' ),
'id' => 'label',
'type' => 'text'
),
array(
'name' => __( 'Meta Value', 'upstudy' ),
'id' => 'value',
'type' => 'text'
),
array(
'name' => __( 'Icon Class', 'upstudy' ),
'id' => 'icon_class',
'type' => 'text',
'description' => __( 'Here you can add icon classes such as Dashicon, Elementor, etc. Learn more about the icons class. <a target="_blank" href="https://devthrow.com/support/docs/upstudy/#icons">go here</a>', 'upstudy' )
),
)
) );
}
// Meta for events speaker
add_action('cmb2_admin_init', 'upstudy_tp_event_speaker_meta');
function upstudy_tp_event_speaker_meta()
{
$tp_event_speaker_meta = new_cmb2_box( array(
'id' => 'upstudy_tp_event_speaker_metabox',
'title' => __( 'Speaker Meta', 'upstudy' ),
'object_types' => array( 'term' ),
'taxonomies' => array( 'tp_event_speaker' ),
'context' => 'normal',
'priority' => 'low',
'show_names' => true
) );
$tp_event_speaker_meta->add_field( array(
'name' => __( 'Designation', 'upstudy' ),
'id' => 'upstudy_tp_event_speaker_designation',
'type' => 'text'
) );
$tp_event_speaker_meta->add_field( array(
'name' => __( 'Speaker Image', 'upstudy' ),
'id' => 'upstudy_tp_event_speaker_image',
'type' => 'file',
'text' => array(
'add_upload_file_text' => __( 'Add Speaker Image', 'upstudy' )
)
) );
$tp_event_speaker_meta->add_field( array(
'name' => __( 'Speaker Details URL', 'upstudy' ),
'id' => 'upstudy_tp_event_speaker_details_url',
'type' => 'text',
'default' => '#'
) );
$tp_event_speaker_meta->add_field( array(
'name' => __( 'Facebook URL', 'upstudy' ),
'id' => 'upstudy_tp_event_speaker_fb_profile',
'type' => 'text',
'default' => '#'
) );
$tp_event_speaker_meta->add_field( array(
'name' => __( 'Twitter URL', 'upstudy' ),
'id' => 'upstudy_tp_event_speaker_tw_profile',
'type' => 'text',
'default' => '#'
) );
$tp_event_speaker_meta->add_field( array(
'name' => __( 'Linkedin URL', 'upstudy' ),
'id' => 'upstudy_tp_event_speaker_lk_profile',
'type' => 'text',
'default' => '#'
) );
}