public static function optionsframework_get_validated_options_filter($clean, $input) { $header_preset_relation = array('inline' => 'wizard01', 'split' => 'wizard02', 'classic' => 'wizard03', 'slide_out' => 'wizard04', 'side' => 'wizard05', 'overlay' => 'wizard06'); $header_layout = $input['header-layout']; $preset_id = isset($header_preset_relation[$header_layout]) ? $header_preset_relation[$header_layout] : 'skin07s'; // Get all saved options. $known_options = get_option('optionsframework', array()); $saved_options = get_option($known_options['id'], array()); if (!is_array($saved_options)) { $saved_options = array(); } // Get preset options. $preset_options = optionsframework_presets_data($preset_id); $preserve = apply_filters('optionsframework_validate_preserve_fields', array()); // Ignore preserved options. foreach ($preserve as $option) { if (isset($preset_options[$option])) { unset($preset_options[$option]); } } if (!isset($preset_options['preset'])) { $preset_options['preset'] = $preset_id; } $sanitized_input = self::sanitize_options((array) $input, $preset_options); $combined_options = self::override_options_filter(array_merge($preset_options, $sanitized_input)); $sanitized_combined_options = self::sanitize_options($combined_options, $preset_options); return array_merge($saved_options, $sanitized_combined_options); }
/** * Format Configuration Array. * * Get an array of all default values as set in * options.php. The 'id','std' and 'type' keys need * to be defined in the configuration array. In the * event that these keys are not present the option * will not be included in this function's output. * * @return array Rey-keyed options configuration array. * * @access private */ function of_get_default_values($page = null) { $output = $preset = $saved_options = array(); $config =& _optionsframework_options(); $known_options = get_option('optionsframework', array()); $tmp_options = get_option($known_options['id'], array()); $first_run = false; // If this is first run - use one of preset if (empty($tmp_options)) { $tmp_options['preset'] = apply_filters('options_framework_first_run_skin', ''); $first_run = true; } // If this is preset page - restore it's defaults if (isset($tmp_options['preset'])) { // Get preset options $preset = optionsframework_presets_data($tmp_options['preset']); // if preset not set - set it if (!isset($preset['preset'])) { $preset['preset'] = $tmp_options['preset']; } // For first run preserve some options if ($first_run) { $preserve = array('widgetareas', 'bottom_bar-copyrights', 'bottom_bar-credits', 'social_buttons-post', 'social_buttons-portfolio', 'social_buttons-albums', 'general-tracking_code', 'general-favicon', 'general-wysiwig_visual_columns'); foreach ($preserve as $option) { if (isset($preset[$option])) { unset($preset[$option]); } } } } // Current page defaults if ($page) { $arr = array(); $found = null; // Find Page options foreach ($config as $option) { if ('options-framework' == $page && null === $found) { $found = true; } elseif (isset($option['type']) && 'page' == $option['type'] && $option['menu_slug'] == $page) { $found = true; continue; } elseif (isset($option['type']) && 'page' == $option['type']) { $found = false; } if ($found) { $arr[] = $option; } } $config = $arr; $saved_options = $tmp_options; } foreach ((array) $config as $option) { if (!isset($option['id'])) { continue; } if (!isset($option['std'])) { continue; } if (!isset($option['type'])) { continue; } if (has_filter('of_sanitize_' . $option['type'])) { $value = $option['std']; // Use defaults from preset if it's present if (isset($preset[$option['id']])) { $preset_value = $preset[$option['id']]; if ('upload' == $option['type'] && isset($option['mode']) && 'full' == $option['mode']) { $preset_value = array_reverse($preset_value); } $value = $preset_value; } $output[$option['id']] = apply_filters('of_sanitize_' . $option['type'], $value, $option); } } $output = array_merge($saved_options, $output); return $output; }
function presscore_admin_fix_theme_options() { $optionsframework_settings = get_option('optionsframework'); $theme_options = get_option($optionsframework_settings['id']); if (!$theme_options) { return; } if (isset($theme_options['top_bar-font-size'])) { $theme_options['top_bar-font-size'] = presscore_options_canonize_font_size($theme_options['top_bar-font-size']); } /** * Images Styling & Hovers. */ if (isset($theme_options['image_hover-with_icons_opacity'])) { $theme_options['image_hover-project_rollover_opacity'] = $theme_options['image_hover-with_icons_opacity']; unset($theme_options['image_hover-with_icons_opacity']); } if ($the72_options = get_option('the72')) { $header_preset_relation = array('left' => 'wizard01', 'center' => 'wizard03', 'classic' => 'wizard03', 'side' => 'wizard05'); $header_layout = $the72_options['header-layout']; $preset_id = isset($header_preset_relation[$header_layout]) ? $header_preset_relation[$header_layout] : 'skin07s'; $preset_options = optionsframework_presets_data($preset_id); // Skin. $the72_options['preset'] = $preset_options['preset']; // Header layout. $the72_options['header-layout'] = $preset_options['header-layout']; if ('center' == $header_layout) { $the72_options['header-classic-logo-position'] = 'center'; $the72_options['header-classic-menu-position'] = 'center'; } // Classic header microwidgets. $microwidgets_elements_relation = array('top_bar_left' => 'top_bar_left', 'top_bar_right' => 'top_bar_right', 'near_menu_right' => 'nav_area', 'near_logo_right' => 'logo_area', 'near_logo_left' => ''); $the72_options['header-classic-elements'] = _presscore_fix_microwidgets_elements_options($microwidgets_elements_relation, $the72_options['header-classic_layout_elements']); // Content boxes. if ('solid' == $the72_options['general-content_boxes_bg_mode']) { $the72_options['general-content_boxes_bg_color'] = $the72_options['general-content_boxes_solid_bg_color']; $the72_options['general-content_boxes_bg_opacity'] = '100'; } // Beautiful loading. if ('accent' == $the72_options['general-beautiful_loading']) { $the72_options['general-fullscreen_overlay_color_mode'] = 'accent'; $the72_options['general-spinner_color'] = '#ffffff'; } $the72_options['general-beautiful_loading'] = 'disabled' == $the72_options['general-beautiful_loading'] ? 'disabled' : 'enabled'; $theme_options = array_merge($preset_options, $the72_options); } update_option($optionsframework_settings['id'], $theme_options); }
/** * Format Configuration Array. * * Get an array of all default values as set in * options.php. The 'id','std' and 'type' keys need * to be defined in the configuration array. In the * event that these keys are not present the option * will not be included in this function's output. * * @return array Rey-keyed options configuration array. * * @access private */ function of_get_default_values($page = null) { $output = $defaults_preset = $saved_options = array(); $config = optionsframework_options(); $known_options = get_option('optionsframework', array()); $tmp_options = get_option($known_options['id'], array()); $first_run = false; if (empty($tmp_options)) { $tmp_options['of-preset'] = 'blue'; $first_run = true; } if (isset($tmp_options['of-preset'])) { $defaults_preset = optionsframework_presets_data($tmp_options['of-preset']); if ($first_run) { $preserve = array('of_generatortest2'); foreach ($preserve as $pres) { if (isset($defaults_preset[$pres])) { unset($defaults_preset[$pres]); } } } } if ($page) { $arr = array(); $found = null; foreach ($config as $option) { if ('options-framework' == $page && null === $found) { $found = true; } elseif (isset($option['type']) && 'page' == $option['type'] && $option['menu_slug'] == $page) { $found = true; continue; } elseif (isset($option['type']) && 'page' == $option['type']) { $found = false; } if ($found) { $arr[] = $option; } } $config = $arr; $saved_options = $tmp_options; } foreach ((array) $config as $option) { if (!isset($option['id'])) { continue; } if (!isset($option['std'])) { continue; } if (!isset($option['type'])) { continue; } if (has_filter('of_sanitize_' . $option['type'])) { $value = $option['std']; if (isset($defaults_preset[$option['id']])) { $value = $defaults_preset[$option['id']]; } $output[$option['id']] = apply_filters('of_sanitize_' . $option['type'], $value, $option); } } $output = array_merge($saved_options, $output); return $output; }
public function import_theme_options($input = array()) { if (!$input) { return $input; } update_option($this->import_status_slug, 'options_imported'); $the72_options = get_option($this->old_options_key); $header_preset_relation = array('side' => 'wizard05', 'left' => 'wizard01', 'classic' => 'wizard03', 'center' => 'wizard03'); $header_layout = $the72_options['header-layout']; $preset_id = isset($header_preset_relation[$header_layout]) ? $header_preset_relation[$header_layout] : 'skin07s'; $preset_options = optionsframework_presets_data($preset_id); // Skin. $the72_options['preset'] = $preset_options['preset']; // Top bar. $the72_options['top_bar-font-size'] = self::fix_font_size_option($the72_options['top_bar-font_size']); $the72_options['top_bar-font-color'] = $the72_options['top_bar-text_color']; $the72_options['top_bar-paddings-top'] = $the72_options['top_bar-paddings-bottom'] = $the72_options['top_bar-paddings']; $the72_options['top_bar-bg-style'] = $the72_options['top_bar-bg_mode']; $the72_options['top_bar-bg-color'] = $the72_options['top_bar-bg_color']; $the72_options['top_bar-bg-opacity'] = $the72_options['top_bar-bg_opacity']; $the72_options['top_bar-bg-image'] = $the72_options['top_bar-bg_image']; // Microwidgets. $the72_options['header-elements-near_menu-font_family'] = $the72_options['fonts-font_family']; $the72_options['header-elements-near_menu-font_size'] = '12'; $the72_options['header-elements-near_menu-font_color'] = $the72_options['menu-font_color']; $the72_options['header-elements-near_logo-font_family'] = $the72_options['fonts-font_family']; $the72_options['header-elements-near_logo-font_size'] = $the72_options['menu-font_size']; $the72_options['header-elements-near_logo-font_color'] = $the72_options['menu-font_color']; // Header. $the72_options['header-layout'] = $preset_options['header-layout']; $the72_options['header-bg-color'] = $the72_options['header-bg_color']; $the72_options['header-bg-opacity'] = $the72_options['header-bg_opacity']; $the72_options['header-bg-image'] = $the72_options['header-bg_image']; $the72_options['header-bg-is_fullscreen'] = $the72_options['header-bg_fullscreen']; $the72_options['header-bg-is_fixed'] = $the72_options['header-bg_fixed']; $the72_options['header-decoration'] = 'shadow'; $the72_options['header-menu-item-padding-top'] = '0'; $the72_options['header-menu-item-padding-bottom'] = '0'; $the72_options['header-menu-item-padding-left'] = '0'; $the72_options['header-menu-item-padding-right'] = '0'; $the72_options['header-menu-item-margin-top'] = '0'; $the72_options['header-menu-item-margin-right'] = '0'; $the72_options['header-menu-item-margin-bottom'] = '0'; $the72_options['header-menu-item-margin-left'] = '0'; $the72_options['header-menu-decoration-other-border-radius'] = '6'; $the72_options['header-menu-decoration-other-links-is_justified'] = '0'; switch ($header_layout) { case 'side': if ('sticky' == $the72_options['header-side_menu_visibility']) { $the72_options['header-layout'] = 'slide_out'; $the72_options['header-slide_out-show_elements'] = 'show' == $the72_options['header-side_layout_elements_visibility'] ? '1' : '0'; $the72_options['header-slide_out-elements'] = self::fix_header_elements_option($header_layout, $the72_options['header-side_layout_elements']); $the72_options['header-slide_out-position'] = $the72_options['header-side_position']; $the72_options['header-slide_out-width'] = $the72_options['header-slide_out-content-width'] = $the72_options['header-side_menu_width']; $the72_options['header-slide_out-layout'] = 'menu_icon'; $the72_options['header-slide_out-layout-menu_icon-show_floating_logo'] = '0'; $the72_options['header-slide_out-overlay-animation'] = 'slide'; $the72_options['header-slide_out-menu-position'] = 'v_top'; $the72_options['header-slide_out-logo-position'] = 'inside'; $the72_options['header-slide_out-elements-below_menu-padding-top'] = '6'; $the72_options['header-slide_out-elements-below_menu-padding-right'] = '0'; $the72_options['header-slide_out-elements-below_menu-padding-bottom'] = '6'; $the72_options['header-slide_out-elements-below_menu-padding-left'] = '0'; $the72_options['header-slide_out-content-padding-top'] = '0'; $the72_options['header-slide_out-content-padding-bottom'] = '0'; $the72_options['header-slide_out-content-padding-right'] = $the72_options['header-side_paddings']; $the72_options['header-slide_out-content-padding-left'] = $the72_options['header-side_paddings']; $the72_options['header-slide_out-content-position'] = 'center'; $the72_options['header-slide_out-menu-items_alignment'] = 'center'; $the72_options['header-slide_out-menu-items_link'] = 'textwidth'; $the72_options['header-menu_icon-hover-bg-color'] = $the72_options['header-menu_icon-bg-color'] = 'color' == $the72_options['general-accent_color_mode'] ? $the72_options['general-accent_bg_color'] : $the72_options['general-accent_bg_color_gradient'][0]; $the72_options['header-menu_icon-hover-bg-opacity'] = $the72_options['header-menu_icon-bg-opacity'] = '100'; $the72_options['header-menu_icon-bg-border-radius'] = '3'; $the72_options['header-menu_icon-margin-top'] = '50'; $the72_options['header-menu_icon-margin-right'] = '0'; $the72_options['header-menu_icon-margin-bottom'] = '0'; $the72_options['header-menu_icon-margin-left'] = '50'; } else { $the72_options['header-side-show_elements'] = 'show' == $the72_options['header-side_layout_elements_visibility'] ? '1' : '0'; $the72_options['header-side-elements'] = self::fix_header_elements_option($header_layout, $the72_options['header-side_layout_elements']); $the72_options['header-side-position'] = $the72_options['header-side_position']; $the72_options['header-side-width'] = $the72_options['header-side-content-width'] = $the72_options['header-side_menu_width']; $the72_options['header-side-menu-position'] = 'v_top'; $the72_options['header-side-logo-position'] = 'inside'; $the72_options['header-side-content-padding-top'] = '0'; $the72_options['header-side-content-padding-bottom'] = '0'; $the72_options['header-side-elements-below_menu-padding-top'] = '6'; $the72_options['header-side-elements-below_menu-padding-right'] = '0'; $the72_options['header-side-elements-below_menu-padding-bottom'] = '6'; $the72_options['header-side-elements-below_menu-padding-left'] = '0'; $the72_options['header-side-content-padding-right'] = $the72_options['header-side_paddings']; $the72_options['header-side-content-padding-left'] = $the72_options['header-side_paddings']; $the72_options['header-side-content-position'] = 'center'; $the72_options['header-side-menu-items_alignment'] = 'center'; $the72_options['header-side-menu-items_link'] = 'textwidth'; } break; case 'left': $the72_options['header-inline-show_elements'] = 'show' == $the72_options['header-left_layout_elements_visibility'] ? '1' : '0'; $the72_options['header-inline-elements'] = self::fix_header_elements_option($header_layout, $the72_options['header-left_layout_elements']); // Hide top bar if it's empty. if (empty($the72_options['header-inline-elements']['top_bar_left']) && empty($the72_options['header-inline-elements']['top_bar_right'])) { $the72_options['top_bar-paddings-top'] = $the72_options['top_bar-paddings-bottom'] = '0'; } $the72_options['header-inline-is_fullwidth'] = '0'; $the72_options['header-inline-elements-near_menu_right-padding-left'] = '30'; $the72_options['header-inline-elements-near_menu_right-padding-right'] = '0'; $the72_options['header-menu-item-padding-top'] = '4'; $the72_options['header-menu-item-padding-bottom'] = '6'; $the72_options['header-inline-menu-position'] = 'center'; break; case 'classic': $the72_options['header-classic-show_elements'] = 'show' == $the72_options['header-classic_layout_elements_visibility'] ? '1' : '0'; $the72_options['header-classic-elements'] = self::fix_header_elements_option($header_layout, $the72_options['header-classic_layout_elements']); // Hide top bar if it's empty. if (empty($the72_options['header-classic-elements']['top_bar_left']) && empty($the72_options['header-classic-elements']['top_bar_right'])) { $the72_options['top_bar-paddings-top'] = $the72_options['top_bar-paddings-bottom'] = '0'; } $the72_options['header-classic-menu-bg-style'] = $the72_options['header-classic_menu_bg_mode']; $the72_options['header-classic-menu-bg-color'] = $the72_options['header-classic_menu_bg_color']; $the72_options['header-classic-menu-bg-opacity'] = $the72_options['header-classic_menu_bg_opacity']; $the72_options['header-classic-logo-position'] = 'left'; $the72_options['header-classic-menu-position'] = 'center'; $the72_options['header-elements-near_logo-font_size'] = self::fix_font_size_option($the72_options['header-near_logo_font_size']); $the72_options['header-elements-near_logo-font_color'] = $the72_options['header-near_logo_bg_color']; break; case 'center': $the72_options['header-classic-show_elements'] = 'show' == $the72_options['header-center_layout_elements_visibility'] ? '1' : '0'; $the72_options['header-classic-elements'] = self::fix_header_elements_option($header_layout, $the72_options['header-center_layout_elements']); // Hide top bar if it's empty. if (empty($the72_options['header-classic-elements']['top_bar_left']) && empty($the72_options['header-classic-elements']['top_bar_right'])) { $the72_options['top_bar-paddings-top'] = $the72_options['top_bar-paddings-bottom'] = '0'; } $the72_options['header-classic-logo-position'] = 'center'; $the72_options['header-classic-menu-position'] = 'center'; $the72_options['header-classic-menu-bg-style'] = $the72_options['header-center_menu_bg_mode']; $the72_options['header-classic-menu-bg-color'] = $the72_options['header-center_menu_bg_color']; $the72_options['header-classic-menu-bg-opacity'] = $the72_options['header-center_menu_bg_opacity']; break; } // Cart. $the72_options['header-elements-woocommerce_cart-caption'] = $the72_options['header-woocommerce_cart_caption']; $the72_options['header-elements-woocommerce_cart-icon'] = $the72_options['header-woocommerce_cart_icon']; $the72_options['header-elements-woocommerce_cart-mobile-layout'] = 'in_menu'; $the72_options['header-elements-woocommerce_cart-show_sub_cart'] = '1'; $the72_options['header-elements-woocommerce_cart-show_subtotal'] = $the72_options['header-woocommerce_show_cart_subtotal']; $the72_options['header-elements-woocommerce_cart-show_counter'] = $the72_options['header-woocommerce_show_counter']; $the72_options['header-elements-woocommerce_cart-counter-style'] = 'rectangular'; $the72_options['header-elements-woocommerce_cart-counter-color'] = $the72_options['header-woocommerce_counter_color']; $the72_options['header-elements-woocommerce_cart-counter-bg'] = $the72_options['header-woocommerce_counter_bg_mode']; $the72_options['header-elements-woocommerce_cart-counter-bg-color'] = $the72_options['header-woocommerce_counter_bg_color']; $the72_options['header-elements-woocommerce_cart-counter-bg-gradient'] = $the72_options['header-woocommerce_counter_bg_color_gradient']; // Search. $the72_options['header-elements-search-caption'] = $the72_options['header-search_caption']; $the72_options['header-elements-search-icon'] = $the72_options['header-search_icon']; $the72_options['header-elements-search-mobile-layout'] = 'in_menu'; // Contact information. $contact_info = array('address', 'phone', 'email', 'skype', 'clock'); foreach ($contact_info as $element) { $the72_options["header-elements-contact-{$element}-caption"] = $the72_options["header-contact_{$element}"]; $the72_options["header-elements-contact-{$element}-icon"] = $the72_options["header-contact_{$element}_icon"]; $the72_options["header-elements-contact-{$element}-mobile-layout"] = 'in_menu'; } // Login. $the72_options['header-elements-login-caption'] = $the72_options['header-login_caption']; $the72_options['header-elements-logout-caption'] = $the72_options['header-logout_caption']; $the72_options['header-elements-login-icon'] = $the72_options['header-login_icon']; $the72_options['header-elements-login-mobile-layout'] = 'in_menu'; $the72_options['header-elements-login-url'] = $the72_options['header-login_url']; // Text. $the72_options['header-elements-text'] = $the72_options['header-text']; $the72_options['header-elements-text-mobile-layout'] = 'in_menu'; // Custom menu. $the72_options['header-elements-text-mobile-layout'] = 'hidden'; // Social icons. $the72_options['header-elements-text-mobile-layout'] = 'hidden'; $the72_options['header-elements-soc_icons-color'] = $the72_options['header-soc_icon_color']; $the72_options['header-elements-soc_icons-bg'] = $the72_options['header-soc_icon_bg_color_mode']; $the72_options['header-elements-soc_icons-bg-color'] = $the72_options['header-soc_icon_bg_color']; $the72_options['header-elements-soc_icons-bg-opacity'] = '100'; $the72_options['header-elements-soc_icons-bg-gradient'] = $the72_options['header-soc_icon_bg_color_gradient']; $the72_options['header-elements-soc_icons-hover-color'] = $the72_options['header-soc_icon_hover_color']; $the72_options['header-elements-soc_icons-hover-bg'] = $the72_options['header-soc_icon_hover_bg_color_mode']; $the72_options['header-elements-soc_icons-hover-bg-color'] = $the72_options['header-soc_icon_hover_bg_color']; $the72_options['header-elements-soc_icons-bg-hover-opacity'] = '100'; $the72_options['header-elements-soc_icons-hover-bg-gradient'] = $the72_options['header-soc_icon_hover_bg_color_gradient']; $the72_options['header-elements-soc_icons'] = array_reverse($the72_options['header-soc_icons']); // Menu. $the72_options['header-menu-font-family'] = $the72_options['menu-font_family']; $the72_options['header-menu-font-size'] = $the72_options['menu-font_size']; $the72_options['header-menu-font-is_capitalized'] = $the72_options['menu-font_uppercase']; $the72_options['header-menu-font-color'] = $the72_options['menu-font_color']; $the72_options['header-menu-hover-font-color-style'] = $the72_options['header-menu-active_item-font-color-style'] = $the72_options['menu-hover_font_color_mode']; $the72_options['header-menu-hover-font-color'] = $the72_options['header-menu-active_item-font-color'] = $the72_options['menu-hover_font_color']; $the72_options['header-menu-hover-font-gradient'] = $the72_options['header-menu-active_item-font-gradient'] = $the72_options['menu-hover_font_color_gradient']; $the72_options['header-menu-icon-size'] = $the72_options['menu-iconfont_size']; $the72_options['header-menu-show_next_lvl_icons'] = $the72_options['menu-next_level_indicator']; $the72_options['header-classic-height'] = $the72_options['header-inline-height'] = $the72_options['header-bg_height']; $the72_options['header-menu-show_dividers'] = '0'; switch ($the72_options['menu-decoration_style']) { // Left to right. case 'underline': $the72_options['header-menu-decoration-style'] = 'underline'; $the72_options['header-menu-decoration-underline-direction'] = 'left_to_right'; $the72_options['header-menu-decoration-underline-color-style'] = $the72_options['menu-hover_decoration_color_mode']; $the72_options['header-menu-decoration-underline-color'] = $the72_options['menu-hover_decoration_color']; $the72_options['header-menu-decoration-underline-gradient'] = $the72_options['menu-hover_decoration_color_gradient']; $the72_options['header-menu-item-padding-top'] = $the72_options['header-menu-item-padding-bottom'] = '4'; break; // From centre. // From centre. case 'brackets': $the72_options['header-menu-decoration-style'] = 'underline'; $the72_options['header-menu-decoration-underline-direction'] = 'from_center'; $the72_options['header-menu-decoration-underline-color-style'] = $the72_options['menu-hover_decoration_color_mode']; $the72_options['header-menu-decoration-underline-color'] = $the72_options['menu-hover_decoration_color']; $the72_options['header-menu-decoration-underline-gradient'] = $the72_options['menu-hover_decoration_color_gradient']; $the72_options['header-menu-item-padding-top'] = $the72_options['header-menu-item-padding-bottom'] = '4'; break; // Upwards. // Upwards. case 'upwards': $the72_options['header-menu-decoration-style'] = 'underline'; $the72_options['header-menu-decoration-underline-direction'] = 'upwards'; $the72_options['header-menu-decoration-underline-color-style'] = $the72_options['menu-hover_decoration_color_mode']; $the72_options['header-menu-decoration-underline-color'] = $the72_options['menu-hover_decoration_color']; $the72_options['header-menu-decoration-underline-gradient'] = $the72_options['menu-hover_decoration_color_gradient']; $the72_options['header-menu-item-padding-top'] = $the72_options['header-menu-item-padding-bottom'] = '4'; break; // Downwards. // Downwards. case 'downwards': $the72_options['header-menu-decoration-style'] = 'underline'; $the72_options['header-menu-decoration-underline-direction'] = 'downwards'; $the72_options['header-menu-decoration-underline-color-style'] = $the72_options['menu-hover_decoration_color_mode']; $the72_options['header-menu-decoration-underline-color'] = $the72_options['menu-hover_decoration_color']; $the72_options['header-menu-decoration-underline-gradient'] = $the72_options['menu-hover_decoration_color_gradient']; $the72_options['header-menu-item-padding-top'] = $the72_options['header-menu-item-padding-bottom'] = '4'; break; // Background & outline. // Background & outline. case 'background': $the72_options['header-menu-decoration-style'] = 'other'; $the72_options['header-menu-decoration-other-hover-style'] = 'outline'; $the72_options['header-menu-decoration-other-click_decor'] = '0'; $the72_options['header-menu-decoration-other-active-style'] = 'background'; $the72_options['header-menu-item-padding-top'] = '7'; $the72_options['header-menu-item-padding-right'] = '11'; $the72_options['header-menu-item-padding-bottom'] = '8'; $the72_options['header-menu-item-padding-left'] = '11'; $the72_options['header-menu-decoration-other-hover-line'] = $the72_options['header-menu-decoration-other-active-line'] = '0'; $the72_options['header-menu-decoration-other-opacity'] = $the72_options['header-menu-decoration-other-active-opacity'] = '100'; // Hover font and hover/active decoration colors. $the72_options['header-menu-hover-font-color-style'] = $the72_options['header-menu-decoration-other-hover-color-style'] = $the72_options['header-menu-decoration-other-active-color-style'] = $the72_options['menu-hover_decoration_color_mode']; $the72_options['header-menu-hover-font-color'] = $the72_options['header-menu-decoration-other-hover-color'] = $the72_options['header-menu-decoration-other-active-color'] = $the72_options['menu-hover_decoration_color']; $the72_options['header-menu-hover-font-gradient'] = $the72_options['header-menu-decoration-other-hover-gradient'] = $the72_options['header-menu-decoration-other-active-gradient'] = $the72_options['menu-hover_decoration_color_gradient']; break; // Material background. // Material background. case 'material': $the72_options['header-menu-decoration-style'] = 'other'; $the72_options['header-menu-decoration-other-hover-style'] = 'background'; $the72_options['header-menu-decoration-other-click_decor'] = '1'; $the72_options['header-menu-decoration-other-active-style'] = 'background'; $the72_options['header-menu-item-padding-top'] = '7'; $the72_options['header-menu-item-padding-right'] = '11'; $the72_options['header-menu-item-padding-bottom'] = '8'; $the72_options['header-menu-item-padding-left'] = '11'; $the72_options['header-menu-decoration-other-hover-line'] = $the72_options['header-menu-decoration-other-active-line'] = '0'; $the72_options['header-menu-decoration-other-active-opacity'] = '100'; // Hover font and hover/active decoration colors. $the72_options['header-menu-decoration-other-click_decor-color-style'] = $the72_options['header-menu-hover-font-color-style'] = $the72_options['header-menu-decoration-other-hover-color-style'] = $the72_options['header-menu-decoration-other-active-color-style'] = $the72_options['menu-hover_decoration_color_mode']; $the72_options['header-menu-decoration-other-click_decor-color'] = $the72_options['header-menu-hover-font-color'] = $the72_options['header-menu-decoration-other-hover-color'] = $the72_options['header-menu-decoration-other-active-color'] = $the72_options['menu-hover_decoration_color']; $the72_options['header-menu-decoration-other-click_decor-gradient'] = $the72_options['header-menu-hover-font-gradient'] = $the72_options['header-menu-decoration-other-hover-gradient'] = $the72_options['header-menu-decoration-other-active-gradient'] = $the72_options['menu-hover_decoration_color_gradient']; break; // Material underline. // Material underline. case 'material_underline': $the72_options['header-menu-decoration-style'] = 'other'; $the72_options['header-menu-decoration-other-hover-style'] = 'background'; $the72_options['header-menu-decoration-other-click_decor'] = '1'; $the72_options['header-menu-decoration-other-active-style'] = 'background'; if ('left' == $header_layout) { $the72_options['header-menu-item-padding-top'] = '0'; $the72_options['header-menu-item-padding-right'] = '0'; $the72_options['header-menu-item-padding-bottom'] = '0'; $the72_options['header-menu-item-padding-left'] = '0'; $the72_options['header-menu-item-margin-top'] = '0'; $the72_options['header-menu-item-margin-right'] = '0'; $the72_options['header-menu-item-margin-bottom'] = '0'; $the72_options['header-menu-item-margin-left'] = '0'; } else { $the72_options['header-menu-item-padding-top'] = $the72_options['header-menu-item-padding-bottom'] = ceil(intval($the72_options['header-bg_height'] - $the72_options['header-menu-font-size']) / 2); $the72_options['header-menu-item-padding-right'] = '9'; $the72_options['header-menu-item-padding-left'] = '9'; $the72_options['header-menu-item-margin-top'] = '0'; $the72_options['header-menu-item-margin-bottom'] = '0'; } $the72_options['header-menu-decoration-other-hover-line'] = $the72_options['header-menu-decoration-other-active-line'] = '1'; $the72_options['header-menu-decoration-other-active-opacity'] = '0'; $the72_options['header-menu-decoration-other-opacity'] = '0'; $the72_options['header-menu-decoration-other-border-radius'] = '0'; $the72_options['header-menu-decoration-other-links-is_justified'] = '1'; $the72_options['header-menu-decoration-other-active-line-opacity'] = '100'; $the72_options['header-menu-decoration-other-hover-line-opacity'] = '100'; // Hover font and hover/active decoration colors. $the72_options['header-menu-decoration-other-hover-line-color-style'] = $the72_options['header-menu-decoration-other-active-line-color-style'] = $the72_options['header-menu-decoration-other-click_decor-color-style'] = $the72_options['header-menu-decoration-other-hover-color-style'] = $the72_options['header-menu-decoration-other-active-color-style'] = $the72_options['menu-hover_decoration_color_mode']; $the72_options['header-menu-decoration-other-hover-line-color'] = $the72_options['header-menu-decoration-other-active-line-color'] = $the72_options['header-menu-decoration-other-click_decor-color'] = $the72_options['header-menu-decoration-other-hover-color'] = $the72_options['header-menu-decoration-other-active-color'] = $the72_options['menu-hover_decoration_color']; $the72_options['header-menu-decoration-other-hover-line-gradient'] = $the72_options['header-menu-decoration-other-active-line-gradient'] = $the72_options['header-menu-decoration-other-click_decor-gradient'] = $the72_options['header-menu-decoration-other-hover-gradient'] = $the72_options['header-menu-decoration-other-active-gradient'] = $the72_options['menu-hover_decoration_color_gradient']; break; // Disabled. // Disabled. default: $the72_options['header-menu-decoration-style'] = 'none'; } if ('side' == $header_layout) { $the72_options['header-menu-item-padding-top'] = $the72_options['header-menu-item-margin-bottom'] = intval(round(intval($the72_options['menu-items_distance']) / 2)); } else { $the72_options['header-menu-item-margin-right'] = $the72_options['header-menu-item-margin-left'] = intval(round(intval($the72_options['menu-items_distance']) / 2)); if ('material_underline' != $the72_options['menu-decoration_style']) { $the72_options['header-menu-item-margin-top'] = $the72_options['header-menu-item-margin-bottom'] = intval(round(intval($the72_options['header-bg_height'] - $the72_options['header-menu-font-size']) / 2)); } } // Submenu. $the72_options['header-menu-submenu-font-family'] = $the72_options['header-menu-submenu-subtitle-font-family'] = $the72_options['submenu-font_family']; $the72_options['header-menu-submenu-font-size'] = $the72_options['submenu-font_size']; $the72_options['header-menu-submenu-font-is_uppercase'] = $the72_options['submenu-font_uppercase']; $the72_options['header-menu-submenu-font-color'] = $the72_options['submenu-font_color']; $the72_options['header-menu-submenu-show_next_lvl_icons'] = $the72_options['submenu-next_level_indicator']; $the72_options['header-menu-submenu-active-font-color-style'] = $the72_options['header-menu-submenu-hover-font-color-style'] = $the72_options['submenu-hover_font_color_mode']; $the72_options['header-menu-submenu-active-font-color'] = $the72_options['header-menu-submenu-hover-font-color'] = $the72_options['submenu-hover_font_color']; $the72_options['header-menu-submenu-active-font-gradient'] = $the72_options['header-menu-submenu-hover-font-gradient'] = $the72_options['submenu-hover_font_color_gradient']; $the72_options['header-menu-submenu-icon-size'] = $the72_options['submenu-iconfont_size']; $the72_options['header-menu-submenu-item-margin-top'] = '0'; $the72_options['header-menu-submenu-item-margin-right'] = '0'; $the72_options['header-menu-submenu-item-margin-bottom'] = '0'; $the72_options['header-menu-submenu-item-margin-left'] = '0'; $the72_options['header-menu-submenu-item-padding-left'] = '10'; $the72_options['header-menu-submenu-item-padding-right'] = '30'; $the72_options['header-menu-submenu-item-padding-top'] = $the72_options['header-menu-submenu-item-padding-bottom'] = intval(round(intval($the72_options['submenu-items_distance']) / 2)); $the72_options['header-menu-submenu-bg-color'] = $the72_options['submenu-bg_color']; $the72_options['header-menu-submenu-bg-opacity'] = $the72_options['submenu-bg_opacity']; $the72_options['header-menu-submenu-bg-width'] = $the72_options['submenu-bg_width']; $the72_options['header-menu-submenu-parent_is_clickable'] = $the72_options['submenu-parent_clickable']; // Floating navigation. $the72_options['header-show_floating_navigation'] = $the72_options['header-show_floating_menu']; $the72_options['header-floating_navigation-height'] = $the72_options['float_menu-height']; if ('header_color' == $the72_options['float_menu-bg_color_mode']) { $the72_options['header-floating_navigation-bg-color'] = $the72_options['header-bg_color']; } else { $the72_options['header-floating_navigation-bg-color'] = $the72_options['float_menu-bg_color']; } $the72_options['header-floating_navigation-bg-opacity'] = $the72_options['float_menu-transparency']; $the72_options['header-floating_navigation-style'] = $the72_options['header-floating_menu_animation']; $the72_options['header-floating_navigation-decoration'] = 'shadow'; // Mobile header. if ('accent' == $the72_options['header-mobile-menu_color']) { $the72_options['header-mobile-menu-font-color'] = $the72_options['submenu-font_color']; $the72_options['header-mobile-menu-bg-color'] = $the72_options['submenu-bg_color']; } else { $the72_options['header-mobile-menu-font-color'] = $the72_options['header-mobile-menu_color-text']; $the72_options['header-mobile-menu-bg-color'] = $the72_options['header-mobile-menu_color-background']; } $the72_options['header-mobile-menu-font-hover-color-style'] = $the72_options['submenu-hover_font_color_mode']; $the72_options['header-mobile-menu-font-hover-color'] = $the72_options['submenu-hover_font_color']; $the72_options['header-mobile-menu-font-hover-gradient'] = $the72_options['submenu-hover_font_color_gradient']; $the72_options['header-mobile-menu-font-family'] = $the72_options['menu-font_family']; $the72_options['header-mobile-menu-font-size'] = $the72_options['menu-font_size']; $the72_options['header-mobile-menu-font-is_capitalized'] = $the72_options['menu-font_uppercase']; $the72_options['header-mobile-submenu-font-family'] = $the72_options['submenu-font_family']; $the72_options['header-mobile-submenu-font-size'] = $the72_options['submenu-font_size']; $the72_options['header-mobile-submenu-font-is_capitalized'] = $the72_options['submenu-font_uppercase']; $the72_options['header-mobile-menu-bg-opacity'] = '100'; $the72_options['header-mobile-floating_navigation'] = 'disabled'; // Branding. // Main. $the72_options['header-logo_regular'] = $the72_options['header-logo_regular']; $the72_options['header-logo_hd'] = $the72_options['header-logo_hd']; $the72_options['header-logo-padding-top'] = $the72_options['header-logo_padding_top']; $the72_options['header-logo-padding-bottom'] = $the72_options['header-logo_padding_bottom']; $the72_options['header-logo-padding-right'] = '0'; $the72_options['header-logo-padding-left'] = '0'; // Transparent. $the72_options['header-style-transparent-logo_regular'] = $the72_options['header-logo_regular']; $the72_options['header-style-transparent-logo_hd'] = $the72_options['header-logo_hd']; $the72_options['header-style-transparent-logo-padding-top'] = $the72_options['header-logo_padding_top']; $the72_options['header-style-transparent-logo-padding-bottom'] = $the72_options['header-logo_padding_bottom']; $the72_options['header-style-transparent-logo-padding-right'] = '0'; $the72_options['header-style-transparent-logo-padding-left'] = '0'; // Menu icon. $the72_options['header-style-mixed-logo_regular'] = array('', 0); $the72_options['header-style-mixed-logo_hd'] = array('', 0); $the72_options['header-style-mixed-logo-padding-top'] = $the72_options['header-logo_padding_top']; $the72_options['header-style-mixed-logo-padding-bottom'] = $the72_options['header-logo_padding_bottom']; $the72_options['header-style-mixed-logo-padding-right'] = '0'; $the72_options['header-style-mixed-logo-padding-left'] = '0'; // Floating navigation. $the72_options['header-style-floating-choose_logo'] = '1' == $the72_options['general-floating_menu_show_logo'] ? 'custom' : 'none'; $the72_options['header-style-floating-logo_regular'] = $the72_options['general-floating_menu_logo_regular']; $the72_options['header-style-floating-logo_hd'] = $the72_options['general-floating_menu_logo_hd']; $the72_options['header-style-floating-logo-padding-top'] = '0'; $the72_options['header-style-floating-logo-padding-bottom'] = '0'; $the72_options['header-style-floating-logo-padding-right'] = '0'; $the72_options['header-style-floating-logo-padding-left'] = '0'; // Mobile logo. $the72_options['header-mobile-first_switch-logo'] = $the72_options['header-mobile-first_switch-logo']; $the72_options['header-mobile-second_switch-logo'] = $the72_options['header-mobile-second_switch-logo']; $the72_options['header-style-mobile-logo_regular'] = $the72_options['general-mobile_logo-regular']; $the72_options['header-style-mobile-logo_hd'] = $the72_options['general-mobile_logo-hd']; $the72_options['header-style-mobile-logo-padding-top'] = $the72_options['general-mobile_logo-padding_top']; $the72_options['header-style-mobile-logo-padding-bottom'] = $the72_options['general-mobile_logo-padding_bottom']; $the72_options['header-style-mobile-logo-padding-right'] = '0'; $the72_options['header-style-mobile-logo-padding-left'] = '0'; // Bottom logo. $the72_options['bottom_bar-logo-padding-top'] = '10'; $the72_options['bottom_bar-logo-padding-bottom'] = '10'; $the72_options['bottom_bar-logo-padding-right'] = '10'; $the72_options['bottom_bar-logo-padding-left'] = '0'; // Content boxes. if ('solid' == $the72_options['general-content_boxes_bg_mode']) { $the72_options['general-content_boxes_bg_color'] = $the72_options['general-content_boxes_solid_bg_color']; $the72_options['general-content_boxes_bg_opacity'] = '100'; } else { $the72_options['general-content_boxes_bg_color'] = '#888888'; $the72_options['general-content_boxes_bg_opacity'] = '8'; } $the72_options['general-content_boxes_decoration'] = 'none'; // Stripes. for ($i = 1; $i <= 3; $i++) { $the72_options["stripes-stripe_{$i}_outline"] = 'hide'; $the72_options["stripes-stripe_{$i}_content_boxes_decoration"] = 'none'; if ('solid' == $the72_options["stripes-stripe_{$i}_content_boxes_bg_mode"]) { $the72_options["stripes-stripe_{$i}_content_boxes_bg_color"] = $the72_options["stripes-stripe_{$i}_content_boxes_solid_bg_color"]; $the72_options["stripes-stripe_{$i}_content_boxes_bg_opacity"] = '100'; } else { $the72_options["stripes-stripe_{$i}_content_boxes_bg_color"] = '#888888'; $the72_options["stripes-stripe_{$i}_content_boxes_bg_opacity"] = '8'; } } // Bottom bar. $the72_options['footer-padding-top'] = $the72_options['footer-paddings-top-bottom']; $the72_options['footer-padding-bottom'] = '10'; switch ($the72_options['footer-style']) { case 'content_width_line': case 'full_width_line': $the72_options['footer-bg_color'] = $the72_options['footer-primary_text_color']; $the72_options['footer-bg_opacity'] = '15'; break; case 'transparent_bg_line': $the72_options['footer-bg_color'] = $the72_options['footer-primary_text_color']; $the72_options['footer-bg_opacity'] = '8'; $the72_options['footer-style'] = 'solid_background'; $the72_options['footer-decoration'] = 'none'; break; case 'solid_background': $the72_options['footer-bg_opacity'] = '100'; break; } switch ($the72_options['bottom_bar-style']) { case 'content_width_line': case 'full_width_line': $the72_options['bottom_bar-bg_color'] = $the72_options['footer-primary_text_color']; $the72_options['bottom_bar-bg_opacity'] = '15'; break; case 'solid_background': $the72_options['bottom_bar-bg_opacity'] = '100'; break; } // Page title. $the72_options['page_title-padding-top'] = $the72_options['page_title-padding-bottom'] = '0'; $the72_options['general-title_decoration'] = 'none'; switch ($the72_options['general-title_bg_mode']) { case 'transparent_bg': $the72_options['general-title_bg_mode'] = 'background'; $the72_options['header-background'] = 'normal'; $the72_options['general-title_bg_color'] = $the72_options['content-primary_text_color']; $the72_options['general-title_bg_opacity'] = '8'; $the72_options['general-title_bg_parallax'] = ''; $the72_options['general-title_bg_image'] = array('image' => '', 'repeat' => 'repeat', 'position_x' => 'center', 'position_y' => 'center'); break; case 'gradient': case 'background': $the72_options['general-title_bg_opacity'] = '100'; if ('transparent' == $the72_options['header-background'] && 'disabled' == $the72_options['header-style']) { $the72_options['header-transparent_bg_opacity'] = '0'; } break; } if (in_array($the72_options['header-menu_top_bar_color_mode'], array('theme', 'dark'))) { $the72_options['page_title-background-style-transparent-color_scheme'] = 'from_options'; } // Buttons. $the72_options['buttons-hover_color_mode'] = $the72_options['buttons-color_mode']; $the72_options['buttons-hover_color'] = $the72_options['buttons-color']; $the72_options['buttons-hover_color_gradient'] = $the72_options['buttons-color_gradient']; $the72_options['buttons-text_hover_color_mode'] = $preset_options['buttons-text_color_mode']; $the72_options['buttons-text_hover_color'] = $preset_options['buttons-text_color']; // Image hovers. $the72_options['image_hover-project_rollover_color_mode'] = $the72_options['image_hover-color_mode']; $the72_options['image_hover-project_rollover_color'] = $the72_options['image_hover-color']; $the72_options['image_hover-project_rollover_color_gradient'] = $the72_options['image_hover-color_gradient']; $the72_options['image_hover-project_rollover_opacity'] = $the72_options['image_hover-opacity']; $the72_options['image_hover-default_icon'] = 'none' == $the72_options['image_hover-default_icon'] ? 'none' : 'big_center'; switch ($the72_options['general-style']) { case 'ios7': $the72_options['general-filter_style'] = $the72_options['general-contact_form_style'] = 'ios'; break; case 'minimalistic': $the72_options['image_hover-project_icons_style'] = 'transparent'; $the72_options['image_hover-album_miniatures_style'] = 'style_1'; $the72_options['general-filter_style'] = $the72_options['general-contact_form_style'] = 'minimal'; break; case 'material': $the72_options['image_hover-project_icons_style'] = 'small'; $the72_options['image_hover-album_miniatures_style'] = 'style_2'; $the72_options['general-filter_style'] = $the72_options['general-contact_form_style'] = 'material'; break; } // Filted style. $the72_options['general-filter-font-family'] = $the72_options['fonts-font_family']; $the72_options['general-filter_ucase'] = '0'; $the72_options['general-filter-padding-top'] = '8'; $the72_options['general-filter-padding-right'] = '13'; $the72_options['general-filter-padding-bottom'] = '8'; $the72_options['general-filter-padding-left'] = '13'; $the72_options['general-filter-margin-top'] = '0'; $the72_options['general-filter-margin-right'] = '5'; $the72_options['general-filter-margin-bottom'] = '0'; $the72_options['general-filter-margin-left'] = '0'; // Beautiful loading. if ('accent' == $the72_options['general-beautiful_loading']) { $the72_options['general-fullscreen_overlay_color_mode'] = 'accent'; $the72_options['general-spinner_color'] = '#ffffff'; } $the72_options['general-beautiful_loading'] = 'disabled' == $the72_options['general-beautiful_loading'] ? 'disabled' : 'enabled'; // Sidebar. $the72_options['sidebar-bg_opacity'] = '100'; $merged_options = array_merge($preset_options, $the72_options); // Validate options. $options_fields =& _optionsframework_options(); foreach ($options_fields as $option_field) { if (isset($option_field['id']) && !array_key_exists($option_field['id'], $merged_options)) { unset($merged_options[$option_field['id']]); } } return apply_filters('presscore_compatibility_import_theme_options', $merged_options); }
/** * Format Configuration Array. * * Get an array of all default values as set in * options.php. The 'id','std' and 'type' keys need * to be defined in the configuration array. In the * event that these keys are not present the option * will not be included in this function's output. * * @return array Rey-keyed options configuration array. * * @access private */ function of_get_default_values($page = null) { $output = $preset = $saved_options = array(); $known_options = get_option('optionsframework', array()); $tmp_options = get_option($known_options['id'], array()); // If this is first run - use one of preset if (empty($tmp_options)) { $tmp_options['preset'] = apply_filters('options_framework_first_run_skin', ''); } // If this is preset page - restore it's defaults if (isset($tmp_options['preset'])) { // Get preset options $preset = optionsframework_presets_data($tmp_options['preset']); // if preset not set - set it if (!isset($preset['preset'])) { $preset['preset'] = $tmp_options['preset']; } } // Current page defaults if ($page) { $config = optionsframework_get_page_options($page); $saved_options = $tmp_options; } else { $config =& _optionsframework_options(); } foreach ((array) $config as $option) { if (!isset($option['id'])) { continue; } if (!isset($option['std'])) { continue; } if (!isset($option['type'])) { continue; } if (has_filter('of_sanitize_' . $option['type'])) { $value = $option['std']; // Use defaults from preset if it's present if (isset($preset[$option['id']])) { $preset_value = $preset[$option['id']]; if ('upload' == $option['type'] && isset($option['mode']) && 'full' == $option['mode']) { $preset_value = array_reverse($preset_value); } $value = $preset_value; } $output[$option['id']] = apply_filters('of_sanitize_' . $option['type'], $value, $option); } } $output = array_merge($saved_options, $output); return apply_filters('of_get_default_values', $output); }