| Server IP : 172.67.71.254 / Your IP : 216.73.216.4 Web Server : nginx/1.27.1 System : Linux in-5 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : arabianexpress ( 1872) PHP Version : 8.0.30 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v9321/leapdubai/public_html/wp-content/themes/printx/inc/ |
Upload File : |
<?php
// tp metabox
add_filter( 'tp_meta_boxes', 'themepure_metabox' );
function themepure_metabox( $meta_boxes ) {
$prefix = 'printx';
$meta_boxes[] = array(
'metabox_id' => $prefix . '_page_meta_box',
'title' => esc_html__( 'TP Page Info', 'printx' ),
'post_type'=> ['page', 'tp-portfolios', 'post'],
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Hide Breadcrumb?', 'printx' ),
'id' => "{$prefix}_check_bredcrumb",
'type' => 'switch',
'default' => 'off',
'conditional' => array()
),
array(
'label' => esc_html__( 'Scroll Indicator', 'printx' ),
'id' => "{$prefix}_scroll_indicator",
'type' => 'switch',
'default' => 'off',
'conditional' => array()
),
[
'label' => esc_html__('Select Breadcrumb Style', 'printx'),
'id' => "{$prefix}_breadcrumb_template",
'type' => 'select',
'options' => [
'' => 'Default',
'1' => 'Style 1',
'2' => 'Style 2 ',
],
'default' => '',
'placeholder' => 'Select an item',
'conditional' => []
],
array(
'label' => esc_html__( 'Show Breadcrumb Image?', 'printx' ),
'id' => "{$prefix}_check_bredcrumb_img",
'type' => 'switch',
'default' => 'on',
'conditional' => array()
),
array(
'label' => esc_html__( 'Breadcrumb Background', 'printx' ),
'id' => "{$prefix}_breadcrumb_bg",
'type' => 'image',
'default' => '',
'conditional' => array(
"{$prefix}_check_bredcrumb_img", "==", "on"
)
),
array(
'label' => esc_html__( 'Enable Secondary Logo', 'printx' ),
'id' => "{$prefix}_en_secondary_logo",
'type' => 'switch',
'default' => 'off',
'conditional' => array()
),
array(
'label' => esc_html__( 'Footer BG', 'printx' ),
'id' => "{$prefix}_footer_bg_image",
'type' => 'image',
'default' => '',
'conditional' => array()
),
array(
'label' => 'Footer BG Color',
'id' => "{$prefix}_footer_bg_color",
'type' => 'colorpicker',
'default' => '',
'conditional' => array()
),
// multiple buttons group field like multiple radio buttons
array(
'label' => esc_html__( 'Header', 'printx' ),
'id' => "{$prefix}_header_tabs",
'desc' => '',
'type' => 'tabs',
'choices' => array(
'default' => esc_html__( 'Default', 'printx' ),
'custom' => esc_html__( 'Custom', 'printx' ),
'elementor' => esc_html__( 'Elementor', 'printx' ),
),
'default' => 'default',
'conditional' => array()
),
// select field dropdown
array(
'label' => esc_html__('Select Header Style', 'printx'),
'id' => "{$prefix}_header_style",
'type' => 'select',
'options' => array(
'header_1' => esc_html__( 'Header 1', 'printx' ),
'header_2' => esc_html__( 'Header 2', 'printx' ),
'header_3' => esc_html__( 'Header 3', 'printx' ),
),
'placeholder' => esc_html__( 'Select a header', 'printx' ),
'conditional' => array(
"{$prefix}_header_tabs", "==", "custom"
),
'default' => 'header_1',
'parent' => "{$prefix}_header_tabs"
),
// select field dropdown
array(
'label' => esc_html__('Select Header Template', 'printx'),
'id' => "{$prefix}_header_templates",
'type' => 'select_posts',
'placeholder' => esc_html__( 'Select a template', 'printx' ),
'post_type' => 'tp-header',
'conditional' => array(
"{$prefix}_header_tabs", "==", "elementor"
),
'default' => '',
'parent' => "{$prefix}_header_tabs"
),
// multiple buttons group field like multiple radio buttons
array(
'label' => esc_html__( 'Footer', 'printx' ),
'id' => "{$prefix}_footer_tabs",
'desc' => '',
'type' => 'tabs',
'choices' => array(
'default' => esc_html__( 'Default', 'printx' ),
'custom' => esc_html__( 'Custom', 'printx' ),
'elementor' => esc_html__( 'Elementor', 'printx' ),
),
'default' => 'default',
'conditional' => array()
),
// select field dropdown
array(
'label' => esc_html__('Select Footer Style', 'printx'),
'id' => "{$prefix}_footer_style",
'type' => 'select',
'options' => array(
'footer_1' => esc_html__( 'Footer 1', 'printx' ),
),
'placeholder' => esc_html__( 'Select a footer', 'printx' ),
'conditional' => array(
"{$prefix}_footer_tabs", "==", "custom"
),
'default' => 'footer_1',
'parent' => "{$prefix}_footer_tabs"
),
// select field dropdown
array(
'label' => esc_html__('Select Footer Template', 'printx'),
'id' => "{$prefix}_footer_template",
'type' => 'select_posts',
'placeholder' => esc_html__( 'Select a template', 'printx' ),
'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', 'printx' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Gallery', '' ),
'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', 'printx' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Video', 'printx' ),
'id' => "{$prefix}_post_video",
'type' => 'text',
'default' => '',
'conditional' => array(),
'placeholder' => esc_html__( 'Place your video url.', 'printx' ),
),
),
'post_format' => 'video'
);
$meta_boxes[] = array(
'metabox_id' => $prefix . '_post_audio_meta',
'title' => esc_html__( 'TP Audio Post', 'printx' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Audio', 'printx' ),
'id' => "{$prefix}_post_audio",
'type' => 'text',
'default' => '',
'conditional' => array(),
'placeholder' => esc_html__( 'Place your audio url..', 'printx' ),
),
),
'post_format' => 'audio'
);
$meta_boxes[] = array(
'metabox_id' => $prefix . '_post_single_template',
'title' => esc_html__( 'Select Post Template Style', 'printx' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
[
'label' => esc_html__('Select Blog Details Style', 'printx'),
'id' => "{$prefix}_blog_single_template",
'type' => 'select',
'options' => [
'' => 'Default',
'1' => 'Style 1',
'2' => 'Style 2 ',
'3' => 'Style 3 ',
],
'default' => '',
'placeholder' => 'Select an item',
'conditional' => []
]
),
'post_type' => 'post'
);
return $meta_boxes;
}
// tp portfolios metabox
add_filter( 'tp_meta_boxes', 'tp_portfolios_metabox' );
function tp_portfolios_metabox($data){
$prefix = 'printx';
$data[] = [
'metabox_id' => $prefix.'_portfoliox_metabox',
'title' => esc_html__('Portfolio Additional Information', 'printx'),
'post_type' => 'tp-portfolios',
'context' => 'normal',
'priority' => 'core',
'fields' => [
[
'label' => esc_html__('Features', 'printx'),
'id' => $prefix.'_port_repeater',
'type' => 'repeater', // specify the type "repeater" (case sensitive)
'conditional' => [],
'default' => [],
'fields' => [
[
'label' => 'Feature Subtitle',
'id' => $prefix.'_pro_subtitle',
'type' => 'text',
'placeholder' => esc_html__('Enter subtitle', 'printx'),
'default' => ''
],
[
'label' => 'Feature Title',
'id' => $prefix.'_pro_title',
'type' => 'text',
'placeholder' => esc_html__('Enter title', 'printx'),
'default' => ''
],
]
],
[
'label' => 'Project Image:',
'id' => $prefix.'_pro_img',
'type' => 'image',
'default' => ''
],
]
];
return $data;
}