/home/moonrcjl/public_html/wp/wp-content/themes/arsha/inc/tp-metabox.php
<?php
// tp metabox
add_filter( 'tp_meta_boxes', 'themepure_metabox' );
function themepure_metabox( $meta_boxes ) {
$prefix = 'arsha';
$meta_boxes[] = array(
'metabox_id' => $prefix . '_page_meta_box',
'title' => esc_html__( 'TP Page Info', 'arsha' ),
'post_type'=> 'page',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Show Breadcrumb?', 'arsha' ),
'id' => "{$prefix}_check_bredcrumb",
'type' => 'switch',
'default' => 'on',
'conditional' => array()
),
array(
'label' => esc_html__( 'Show Breadcrumb Image?', 'arsha' ),
'id' => "{$prefix}_check_bredcrumb_img",
'type' => 'switch',
'default' => 'on',
'conditional' => array()
),
array(
'label' => esc_html__( 'Enable Secondary Logo', 'arsha' ),
'id' => "{$prefix}_en_secondary_logo",
'type' => 'switch',
'default' => 'off',
'conditional' => array()
),
array(
'label' => esc_html__( 'Breadcrumb Background', 'arsha' ),
'id' => "{$prefix}_breadcrumb_bg",
'type' => 'image',
'default' => '',
'conditional' => array(
"{$prefix}_check_bredcrumb_img", "==", "on"
)
),
array(
'label' => 'Breadcrumb Sub Title',
'id' => "{$prefix}_breadcrumb_sub_title",
'type' => 'text', // specify the type field
'placeholder' => __('Please set breadcrumb sub title','arsha'),
'default' => '', // do not remove default key
),
array(
'label' => esc_html__( 'Footer BG', 'arsha' ),
'id' => "{$prefix}_footer_bg_image",
'type' => 'image',
'default' => '',
'conditional' => array()
),
array(
'label' => esc_html__( 'Colorpicker', 'arsha' ),
'id' => "{$prefix}_footer_bg_color",
'type' => 'colorpicker',
'placeholder' => '',
'default' => '',
'conditional' => array()
),
// multiple buttons group field like multiple radio buttons
array(
'label' => esc_html__( 'Header', 'arsha' ),
'id' => "{$prefix}_header_tabs",
'desc' => '',
'type' => 'tabs',
'choices' => array(
'default' => esc_html__( 'Default', 'arsha' ),
'custom' => esc_html__( 'Custom', 'arsha' ),
'elementor' => esc_html__( 'Elementor', 'arsha' ),
),
'default' => 'default',
'conditional' => array()
),
// select field dropdown
array(
'label' => esc_html__('Select Header Style', 'arsha'),
'id' => "{$prefix}_header_style",
'type' => 'select',
'options' => array(
'header_1' => esc_html__( 'Header 1', 'arsha' ),
'header_2' => esc_html__( 'Header 2', 'arsha' ),
'header_3' => esc_html__( 'Header 3', 'arsha' ),
'header_4' => esc_html__( 'Header 4', 'arsha' ),
'header_5' => esc_html__( 'Header 5', 'arsha' ),
),
'placeholder' => esc_html__( 'Select a header', 'arsha' ),
'conditional' => array(
"{$prefix}_header_tabs", "==", "custom"
),
'default' => 'header_1',
'parent' => "{$prefix}_header_tabs",
'context' => 'normal'
),
// select field dropdown
array(
'label' => esc_html__('Select Header Template', 'arsha'),
'id' => "{$prefix}_header_templates",
'type' => 'select_posts',
'placeholder' => esc_html__( 'Select a template', 'arsha' ),
'post_type' => 'tp-header',
'conditional' => array(
"{$prefix}_header_tabs", "==", "elementor"
),
'parent' => "{$prefix}_header_tabs",
'default' => '',
),
// multiple buttons group field like multiple radio buttons
array(
'label' => esc_html__( 'Footer', 'arsha' ),
'id' => "{$prefix}_footer_tabs",
'desc' => '',
'type' => 'tabs',
'choices' => array(
'default' => esc_html__( 'Default', 'arsha' ),
'custom' => esc_html__( 'Custom', 'arsha' ),
'elementor' => esc_html__( 'Elementor', 'arsha' ),
),
'default' => 'default',
'conditional' => array()
),
// select field dropdown
array(
'label' => esc_html__('Select Footer Style', 'arsha'),
'id' => "{$prefix}_footer_style",
'type' => 'select',
'options' => array(
'footer_1' => esc_html__( 'Footer 1', 'arsha' ),
'footer_2' => esc_html__( 'Footer 2', 'arsha' ),
'footer_3' => esc_html__( 'Footer 3', 'arsha' ),
'footer_4' => esc_html__( 'Footer 4', 'arsha' ),
'footer_5' => esc_html__( 'Footer 5', 'arsha' ),
),
'placeholder' => esc_html__( 'Select a footer', 'arsha' ),
'conditional' => array(
"{$prefix}_footer_tabs", "==", "custom"
),
'default' => 'footer_1',
'parent' => "{$prefix}_footer_tabs"
),
// select field dropdown
array(
'label' => esc_html__('Select Footer Template', 'arsha'),
'id' => "{$prefix}_footer_template",
'type' => 'select_posts',
'placeholder' => esc_html__( 'Select a template', 'arsha' ),
'post_type' => 'tp-footer',
'conditional' => array(
"{$prefix}_footer_tabs", "==", "elementor"
),
'default' => '',
'parent' => "{$prefix}_footer_tabs"
),
),
);
$meta_boxes[] = array(
'metabox_id' => $prefix . '_post_gallery_meta',
'title' => esc_html__( 'TP Gallery Post', 'arsha' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Gallery Images Here', 'arsha' ),
'id' => "{$prefix}_post_gallery",
'type' => 'gallery',
'default' => '',
'conditional' => array(),
),
),
'post_format' => 'gallery'
);
$meta_boxes[] = array(
'metabox_id' => $prefix . '_post_video_meta',
'title' => esc_html__( 'TP Video Post', 'arsha' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Video URL Here', 'arsha' ),
'id' => "{$prefix}_post_video",
'type' => 'text',
'default' => '',
'conditional' => array(),
'placeholder' => esc_html__( 'Place your video url.', 'arsha' ),
),
),
'post_format' => 'video'
);
$meta_boxes[] = array(
'metabox_id' => $prefix . '_post_audio_meta',
'title' => esc_html__( 'TP Audio Post', 'arsha' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Audio URL Here', 'arsha' ),
'id' => "{$prefix}_post_audio",
'type' => 'text',
'default' => '',
'conditional' => array(),
'placeholder' => esc_html__( 'Place your audio url..', 'arsha' ),
),
),
'post_format' => 'audio'
);
return $meta_boxes;
}
function arsha_user_meta(){
$meta = array(
'id' => 'arsha_user_main_meta',
'label' => 'Arsha User Meta',
'fields' => array(
array(
'id' => 'arsha_user_facebook_url',
'label' => 'Facebook URL',
'type' => 'text',
'default' => 'https://facebook.com',
'placeholder' => 'Facebook URL...' ,
'show_in_admin_table' => 1
),
array(
'id' => 'arsha_user_twitter_url',
'label' => 'Twitter URL',
'type' => 'text',
'default' => 'https://twitter.com',
'placeholder' => 'Twitter URL...' ,
'show_in_admin_table' => 1
),
array(
'id' => 'arsha_user_instagram_url',
'label' => 'Instagram URL',
'type' => 'text',
'default' => 'https://instagram.com',
'placeholder' => 'Instagram URL...' ,
'show_in_admin_table' => 1
),
array(
'id' => 'arsha_user_linkedin_url',
'label' => 'Linkedin URL',
'type' => 'text',
'default' => 'https://linkedin.com',
'placeholder' => 'Linkedin URL...' ,
'show_in_admin_table' => 1
),
)
);
return $meta;
}
add_filter('tp_user_meta', 'arsha_user_meta');