Sindbad~EG File Manager
<?php
if (!function_exists('imic_register_post_box')) {
add_action('admin_init', 'imic_register_post_box');
function imic_register_post_box() {
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
$post_types = array(
'' => esc_html__('Select','framework'),
'post' => esc_html__('Post', 'framework'),
'speaker' => esc_html__('Speaker','framework'),
'gallery' => esc_html__('Gallery','framework'),
'sermon' => esc_html__('Sermon','framework'),
'product' => esc_html__('Product','framework'),
);
$product_cat = 'product_cat';
}
else {
$post_types = array(
'' => esc_html__('Select','framework'),
'post' => esc_html__('Post', 'framework'),
'speaker' => esc_html__('Speaker','framework'),
'gallery' => esc_html__('Gallery','framework'),
'sermon' => esc_html__('Sermon','framework'),
);
$product_cat = 'category';
}
if (!function_exists('imic_get_all_sidebars')) {
function imic_get_all_sidebars() {
$all_sidebars = array();
global $wp_registered_sidebars;
$all_sidebars = array('' => '');
foreach ($wp_registered_sidebars as $sidebar) {
$all_sidebars[$sidebar['id']] = $sidebar['name'];
}
return $all_sidebars;
}
}
// Check if plugin is activated or included in theme
if (!class_exists('RW_Meta_Box'))
return;
$prefix = 'imic_';
//Event Counter Section
$meta_box = array(
'id' => 'template-home28',
'title' => esc_html__('Event Counter Section', 'framework'),
'show' => array('template' => array('template-home.php','template-home-second.php','template-home-pb.php')),
'pages' => array('page'),
'show_names' => true,
'fields' => array(
array(
'name' => esc_html__('Enable/Disable Section', 'framework'),
'id' => $prefix . 'event_counter',
'desc' => esc_html__("Select enable to show upcoming event countdown section.", 'framework'),
'type' => 'select',
'options' => array(
'0' => esc_html__('Disable', 'framework'),
'1' => esc_html__('Enable','framework'),
),
'std' => 0,
),
array(
'name' => esc_html__('Counter Title', 'framework'),
'id' => $prefix . 'event_counter_title',
'desc' => esc_html__("Enter the event counter title.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_event_counter','=','1')
),
array(
'name' => esc_html__( 'Event Category', 'framework' ),
'id' => $prefix . 'counter_event_category',
'desc' => esc_html__("Choose event category", 'framework'),
'type' => 'taxonomy_advanced',
'options' => array(
'taxonomy' => 'event-category',
'type' => 'select',
'args' => array('orderby' => 'count', 'hide_empty' => true)
),
'visible' => array('imic_event_counter','=','1')
),
)
);
new RW_Meta_Box($meta_box);
$meta_box = array(
'id' => 'template-home26',
'title' => esc_html__('Post Section 1', 'framework'),
'show' => array('template' => array('template-home.php','template-home-second.php')),
'pages' => array('page'),
'show_names' => true,
'fields' => array(
array(
'name' => esc_html__('Enable/Disable Section', 'framework'),
'id' => $prefix . 'status_section1',
'desc' => esc_html__("Select Enable to show latest posts.", 'framework'),
'type' => 'select',
'options' => array(
'0' => esc_html__('Disable', 'framework'),
'1' => esc_html__('Enable','framework'),
),
'std' => 0,
),
array(
'name' => 'Select Sidebar',
'id' => $prefix . 'section1_homepage_sidebar',
'desc' => esc_html__("Select sidebar for this section.", 'framework'),
'type' => 'select',
'options' => imic_get_all_sidebars(),
'visible' => array('imic_status_section1','=','1')
),
array(
'name' => esc_html__('Link Title', 'framework'),
'id' => $prefix . 'section1_link_title',
'desc' => esc_html__("Enter the link title.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_section1','=','1')
),
array(
'name' => esc_html__('Link to page', 'framework'),
'id' => $prefix . 'section1_page_link',
'desc' => esc_html__("Enter the page link.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_section1','=','1')
),
array(
'name' => esc_html__('Heading Title', 'framework'),
'id' => $prefix . 'section1_heading',
'desc' => esc_html__("Enter the heading title.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_section1','=','1')
),
array(
'name' => esc_html__('Event Type', 'framework'),
'id' => $prefix . 'section1_event_type',
'desc' => esc_html__("Select event type.", 'framework'),
'type' => 'select',
'options' => array(
'future' => esc_html__('Future', 'framework'),
'past' => esc_html__('Past','framework'),
),
'std' => 'future',
'visible' => array('imic_status_section1','=','1')
),
array(
'name' => esc_html__( 'Event Category', 'framework' ),
'id' => $prefix . 'section1_event_category',
'desc' => esc_html__("Choose event category", 'framework'),
'type' => 'taxonomy_advanced',
'options' => array(
'taxonomy' => 'event-category',
'type' => 'select',
'args' => array('orderby' => 'count', 'hide_empty' => true)
),
'visible' => array('imic_status_section1','=','1')
),
array(
'name' => esc_html__('Events Count', 'framework'),
'id' => $prefix . 'section1_event_count',
'desc' => esc_html__("Enter the number of events to show.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_section1','=','1')
),
)
);
new RW_Meta_Box($meta_box);
/* * **Home Page Meta Box1 *** */
$meta_box = array(
'id' => 'template-home25',
'title' => esc_html__('Post Section 2', 'framework'),
'show' => array('template' => array('template-home.php','template-home-second.php')),
'pages' => array('page'),
'show_names' => true,
'fields' => array(
array(
'name' => esc_html__('Enable/Disable Section', 'framework'),
'id' => $prefix . 'status_section2',
'desc' => esc_html__("Select enable to show latest posts.", 'framework'),
'type' => 'select',
'options' => array(
'0' => esc_html__('Disable', 'framework'),
'1' => esc_html__('Enable','framework'),
),
'std' => 0,
),
array(
'name' => 'Select Sidebar',
'id' => $prefix . 'section2_homepage_sidebar',
'desc' => esc_html__("Select Sidebar for this section.", 'framework'),
'type' => 'select',
'options' => imic_get_all_sidebars(),
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__('Enable/Disable Latest Post', 'framework'),
'id' => $prefix . 'status_latest_post',
'desc' => esc_html__("Select enable to show the very latest post in a seperate block.", 'framework'),
'type' => 'select',
'options' => array(
'0' => esc_html__('Disable', 'framework'),
'1' => esc_html__('Enable','framework'),
),
'std' => 1,
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__('Latest Post Title', 'framework'),
'id' => $prefix . 'section2_recent_title',
'desc' => esc_html__("Enter the latest post section title.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_latest_post','=','1')
),
array(
'name' => esc_html__('Heading Title', 'framework'),
'id' => $prefix . 'section2_heading',
'desc' => esc_html__("Enter the title for this section.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__('Recent Post Excerpt', 'framework'),
'id' => $prefix . 'section2_excerpt_length',
'desc' => esc_html__("Enter the excerpt length for recent post section.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__('Select Post Type', 'framework'),
'id' => $prefix . 'selected_post_type',
'desc' => esc_html__("Select post type.", 'framework'),
'type' => 'select',
'options' => $post_types,
'std' => 'post',
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__( 'Post Category', 'framework' ),
'id' => $prefix . 'post_category',
'desc' => esc_html__("Choose post category", 'framework'),
'type' => 'taxonomy_advanced',
'options' => array(
'taxonomy' => 'category',
'type' => 'select',
'args' => array('orderby' => 'count', 'hide_empty' => true)
),
'visible' => array('imic_selected_post_type','=','post')
),
array(
'name' => esc_html__( 'Event Category', 'framework' ),
'id' => $prefix . 'event_category',
'desc' => esc_html__("Choose event category", 'framework'),
'type' => 'taxonomy_advanced',
'options' => array(
'taxonomy' => 'event-category',
'type' => 'select',
'args' => array('orderby' => 'count', 'hide_empty' => true)
),
'visible' => array('imic_selected_post_type','=','event')
),
array(
'name' => esc_html__( 'Gallery Category', 'framework' ),
'id' => $prefix . 'gallery_category',
'desc' => esc_html__("Choose gallery category", 'framework'),
'type' => 'taxonomy_advanced',
'options' => array(
'taxonomy' => 'gallery-category',
'type' => 'select',
'args' => array('orderby' => 'count', 'hide_empty' => true)
),
'visible' => array('imic_selected_post_type','=','gallery')
),
array(
'name' => esc_html__( 'Sermon Category', 'framework' ),
'id' => $prefix . 'sermon_category',
'desc' => esc_html__("Choose sermon category", 'framework'),
'type' => 'taxonomy_advanced',
'options' => array(
'taxonomy' => 'sermon-category',
'type' => 'select',
'args' => array('orderby' => 'count', 'hide_empty' => true)
),
'visible' => array('imic_selected_post_type','=','sermon')
),
array(
'name' => esc_html__( 'Product Category', 'framework' ),
'id' => $prefix . 'product_category',
'desc' => esc_html__("Choose product category", 'framework'),
'type' => 'taxonomy_advanced',
'options' => array(
'taxonomy' => $product_cat,
'type' => 'select',
'args' => array('orderby' => 'count', 'hide_empty' => true)
),
'visible' => array('imic_selected_post_type','=','product')
),
array(
'name' => esc_html__( 'Select Post Options', 'framework' ),
'id' => $prefix.'select_post_options',
'type' => 'checkbox_list',
'options' => array(
'thumb' => esc_html__( 'Thumbnail', 'framework' ),
'title' => esc_html__( 'Title', 'framework' ),
'text' => esc_html__( 'Text', 'framework' ),
'more' => esc_html__('Read More','framework'),
),
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__( 'Select Post Content Type', 'framework' ),
'id' => $prefix.'select_post_content',
'type' => 'radio',
'options' => array(
'excerpt' => esc_html__( 'Excerpt', 'framework' ),
'content' => esc_html__( 'Content', 'framework' ),
),
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__('Post Excerpt', 'framework'),
'id' => $prefix . 'section2_post_excerpt_length',
'desc' => esc_html__("Enter the excerpt length for post section.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__( 'Select Image Hyperlink', 'framework' ),
'id' => $prefix.'select_thumb_hyperlink',
'type' => 'radio',
'options' => array(
'0' => esc_html__( 'No Link', 'framework' ),
'image' => esc_html__( 'Big Image', 'framework' ),
'single' => esc_html__( 'Link featured image to single post page.', 'framework' ),
),
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__( 'Select Title Hyperlink', 'framework' ),
'id' => $prefix.'select_title_hyperlink',
'type' => 'radio',
'options' => array(
'0' => esc_html__( 'No Link', 'framework' ),
'single' => esc_html__( 'Link title of posts to single post page.', 'framework' ),
),
'visible' => array('imic_status_section2','=','1')
),
array(
'name' => esc_html__('Number of Latest Posts to show on page', 'framework'),
'id' => $prefix . 'posts_to_show_on',
'desc' => esc_html__("Enter the number of latest posts to show on page. Example: 3", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_section2','=','1')
),
)
);
new RW_Meta_Box($meta_box);
//Gallery Section
$meta_box = array(
'id' => 'template-home27',
'title' => esc_html__('Gallery Section', 'framework'),
'show' => array('template' => array('template-home.php','template-home-second.php')),
'pages' => array('page'),
'show_names' => true,
'fields' => array(
array(
'name' => esc_html__('Enable/Disable Section', 'framework'),
'id' => $prefix . 'status_gallery',
'desc' => esc_html__("Select enable to show gallery section.", 'framework'),
'type' => 'select',
'options' => array(
'0' => esc_html__('Disable', 'framework'),
'1' => esc_html__('Enable','framework'),
),
'std' => 0,
),
array(
'name' => esc_html__('Gallery Title', 'framework'),
'id' => $prefix . 'gallery_title',
'desc' => esc_html__("Enter the gallery section title.", 'framework'),
'type' => 'text',
'std' => '',
'visible' => array('imic_status_gallery','=','1')
),
)
);
new RW_Meta_Box($meta_box);
}
}
?>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists