Пример #1
0
 function of_get_option($name, $default = false)
 {
     static $saved_options = null;
     if (null === $saved_options) {
         $saved_options = optionsframework_get_options();
         if (null === $saved_options) {
             return $default;
         }
         $saved_options = apply_filters('dt_of_get_option_static', $saved_options);
     }
     $options = apply_filters('dt_of_get_option', $saved_options, $name);
     if (isset($options[$name])) {
         return $options[$name];
     }
     return $default;
 }
Пример #2
0
function presscore_theme_options_back_compatibility_check() {

	// top bar social icons
	if ( null === of_get_option( 'header-soc_icons', null ) ) {
		$theme_options = optionsframework_get_options();

		if ( $theme_options ) {

			$social_icons = array();
			$social_icons_data = presscore_get_social_icons_data();
			$social_icons_list = array_keys($social_icons_data);
			foreach ( $social_icons_list as $icon ) {

				$icon_option_id = "top_bar-soc_ico_{$icon}";
				if ( array_key_exists($icon_option_id, $theme_options) && !empty($theme_options[ $icon_option_id ]) ) {
					$social_icons[] = array(
						'icon' => $icon,
						'url' => $theme_options[ $icon_option_id ]
					);
				}

			}

			$theme_options['header-soc_icons'] = $social_icons;
			update_option( optionsframework_get_options_id(), $theme_options );
		}
	}
}
 function of_get_option($name, $default = false)
 {
     if (false === ($saved_options = wp_cache_get('saved_options', 'optionsframework'))) {
         $saved_options = optionsframework_get_options();
         $saved_options = apply_filters('dt_of_get_option_static', $saved_options);
         wp_cache_set('saved_options', $saved_options, 'optionsframework');
     }
     $options = apply_filters('dt_of_get_option', $saved_options, $name);
     if (isset($options[$name])) {
         return $options[$name];
     }
     if (false === $default && null !== ($def_val = _optionsframework_get_option_default_value($name))) {
         return $def_val;
     }
     return $default;
 }