Esempio n. 1
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 );
		}
	}
}
/**
 * Description here.
 *
 */
function optionsframework_get_options()
{
    $config_id = optionsframework_get_options_id();
    $config = get_option('optionsframework');
    if (!isset($config['knownoptions']) || !in_array($config_id, $config['knownoptions'])) {
        return null;
    }
    return get_option($config_id);
}