function axiom_options_settings_theme_setup2() { if (axiom_options_is_used()) { global $AXIOM_GLOBALS; // Replace arrays with actual parameters $lists = array(); foreach ($AXIOM_GLOBALS['options'] as $k => $v) { if (isset($v['options']) && is_array($v['options'])) { foreach ($v['options'] as $k1 => $v1) { if (axiom_substr($k1, 0, 7) == '$axiom_' || axiom_substr($v1, 0, 7) == '$axiom_') { $list_func = axiom_substr(axiom_substr($k1, 0, 7) == '$axiom_' ? $k1 : $v1, 1); unset($AXIOM_GLOBALS['options'][$k]['options'][$k1]); if (isset($lists[$list_func])) { $AXIOM_GLOBALS['options'][$k]['options'] = axiom_array_merge($AXIOM_GLOBALS['options'][$k]['options'], $lists[$list_func]); } else { if (function_exists($list_func)) { $AXIOM_GLOBALS['options'][$k]['options'] = $lists[$list_func] = axiom_array_merge($AXIOM_GLOBALS['options'][$k]['options'], $list_func == 'axiom_get_list_menus' ? $list_func(true) : $list_func()); } else { echo sprintf(__('Wrong function name %s in the theme options array', 'axiom'), $list_func); } } } } } } } }
function axiom_post_type_theme_setup() { if (!axiom_options_is_used()) { return; } $post_type = axiom_admin_get_current_post_type(); if (empty($post_type)) { $post_type = 'post'; } $override_key = axiom_get_override_key($post_type, 'post_type'); if ($override_key) { // Set post type action add_action('save_post', 'axiom_post_type_save_options'); add_action('admin_menu', 'axiom_post_type_add_meta_box'); add_action('admin_enqueue_scripts', 'axiom_post_type_admin_scripts'); // Create meta box global $AXIOM_GLOBALS; $AXIOM_GLOBALS['post_meta_box'] = array('id' => 'post-meta-box', 'title' => __('Theme Options', 'axiom'), 'page' => $post_type, 'context' => 'normal', 'priority' => 'high', 'fields' => array()); } }
function axiom_options_theme_setup() { if (is_admin()) { // Add Theme Options in WP menu add_action('admin_menu', 'axiom_options_admin_menu_item'); if (axiom_options_is_used()) { // Make custom stylesheet when save theme options //add_filter("axiom_filter_save_options", 'axiom_options_save_stylesheet', 10, 2); // Ajax Save and Export Action handler add_action('wp_ajax_axiom_options_save', 'axiom_options_save'); add_action('wp_ajax_nopriv_axiom_options_save', 'axiom_options_save'); // Ajax Import Action handler add_action('wp_ajax_axiom_options_import', 'axiom_options_import'); add_action('wp_ajax_nopriv_axiom_options_import', 'axiom_options_import'); // Prepare global variables global $AXIOM_GLOBALS; $AXIOM_GLOBALS['to_data'] = null; $AXIOM_GLOBALS['to_delimiter'] = ','; } } }
function axiom_shortcodes_is_used() { return axiom_options_is_used() || is_admin() && isset($_POST['action']) && in_array($_POST['action'], array('vc_edit_form', 'wpb_show_edit_form')) || axiom_vc_is_frontend(); // VC Frontend editor mode }
function axiom_sc_selector_add_in_toolbar() { if (!axiom_options_is_used()) { return; } axiom_sc_load_scripts(); axiom_sc_prepare_scripts(); global $AXIOM_GLOBALS; $shortcodes = $AXIOM_GLOBALS['shortcodes']; $shortcodes_list = '<select class="sc_selector"><option value=""> ' . __('- Select Shortcode -', 'axiom') . ' </option>'; foreach ($shortcodes as $idx => $sc) { $shortcodes_list .= '<option value="' . esc_attr($idx) . '" title="' . esc_attr($sc['desc']) . '">' . esc_html($sc['title']) . '</option>'; } $shortcodes_list .= '</select>'; echo $shortcodes_list; }