ID, 'accordions_data', true); $post_id = $post->ID; $settings_tabs_field = new settings_tabs_field(); $accordion_settings_tab = array(); $accordions_options = get_post_meta($post_id, 'accordions_options', true); $current_tab = isset($accordions_options['current_tab']) ? $accordions_options['current_tab'] : 'content'; $view_type = !empty($accordions_options['view_type']) ? $accordions_options['view_type'] : 'accordion'; //var_dump($view_type); $accordion_settings_tab[] = array( 'id' => 'shortcode', 'icon' => '', 'title' => __('Shortcode', 'accordions'), 'priority' => 1, 'active' => ($current_tab == 'shortcode') ? true : false, ); $accordion_settings_tab[] = array( 'id' => 'general', 'icon' => '', 'title' => __('General', 'accordions'), 'priority' => 2, 'active' => ($current_tab == 'general') ? true : false, ); $accordion_settings_tab[] = array( 'id' => 'accordion_options', 'icon' => '', 'title' => __('Accordion options', 'accordions'), 'priority' => 2, 'active' => ($current_tab == 'accordion_options') ? true : false, 'hidden' => ($view_type == 'tabs') ? true : false, 'data_visible' => 'accordion', ); $accordion_settings_tab[] = array( 'id' => 'style', 'icon' => '', 'title' => __('Style', 'accordions'), 'priority' => 3, 'active' => ($current_tab == 'style') ? true : false, ); $accordion_settings_tab[] = array( 'id' => 'tabs_options', 'icon' => '', 'title' => __('Tabs options', 'accordions'), 'priority' => 2, 'active' => ($current_tab == 'tabs_options') ? true : false, 'hidden' => ($view_type == 'accordion') ? true : false, 'data_visible' => 'tabs', ); $accordion_settings_tab[] = array( 'id' => 'content', 'icon' => '', 'title' => __('Content', 'accordions'), 'priority' => 4, 'active' => ($current_tab == 'content') ? true : false, ); $accordion_settings_tab[] = array( 'id' => 'custom_scripts', 'icon' => '', 'title' => __('Custom scripts', 'accordions'), 'priority' => 6, 'active' => ($current_tab == 'buy_pro') ? true : false, ); $accordion_settings_tab[] = array( 'id' => 'help_support', 'icon' => '', 'title' => __('Help support', 'accordions'), 'priority' => 80, 'active' => ($current_tab == 'help_support') ? true : false, ); $accordion_settings_tab[] = array( 'id' => 'buy_pro', 'icon' => '', 'title' => __('Buy pro', 'accordions'), 'priority' => 90, 'active' => ($current_tab == 'buy_pro') ? true : false, ); $accordion_settings_tab = apply_filters('accordions_metabox_navs', $accordion_settings_tab); $tabs_sorted = array(); if (!empty($accordion_settings_tab)) foreach ($accordion_settings_tab as $page_key => $tab) $tabs_sorted[$page_key] = isset($tab['priority']) ? $tab['priority'] : 0; array_multisort($tabs_sorted, SORT_ASC, $accordion_settings_tab); ?>