Ejemplo n.º 1
0
    $current_options['more_button_func'] = get_options_field_value($options, 'more_button_func', '');
    $current_options['twitter_shareshort_service'] = get_options_field_value($options, 'twitter_shareshort_service', '');
    $current_options['display_excerpt_pos'] = get_options_field_value($options, 'display_excerpt_pos', '');
    $current_options['display_excerpt'] = get_options_field_value($options, 'display_excerpt', 'false');
    $current_options['display_position_mobile_sidebar'] = get_options_field_value($options, 'display_position_mobile_sidebar', '');
    $current_options['force_hide_buttons_on_all_mobile'] = get_options_field_value($options, 'force_hide_buttons_on_all_mobile', 'false');
    $current_options['always_hide_names_mobile'] = get_options_field_value($options, 'always_hide_names_mobile', 'false');
    $current_options['admin_ajax_cache'] = get_options_field_value($options, 'admin_ajax_cache', '');
    $current_options['activate_total_counter_text'] = get_options_field_value($options, 'activate_total_counter_text', 'false');
    $current_options['total_counter_hidden_till'] = get_options_field_value($options, 'total_counter_hidden_till', '');
    //$current_options['use_minified_css'] = get_options_field_value($options, 'use_minified_css', 'true');
    //$current_options['use_minified_js'] = get_options_field_value($options, 'use_minified_js', 'true');
    $current_options['using_yoast_ga'] = get_options_field_value($options, 'using_yoast_ga', 'true');
    //$current_options['apply_clean_buttons'] = get_options_field_value($options, 'apply_clean_buttons', 'true');
    update_option(EasySocialShareButtons::$plugin_settings_name, $current_options);
    ESSBCache::flush();
    if (function_exists('purge_essb_cache_static_cache')) {
        purge_essb_cache_static_cache();
    }
    echo "<script type='text/javascript'>window.location='" . admin_url() . "admin.php?page=essb_settings&tab=general#wizard';</script>";
}
function get_options_field_value($options, $key, $default)
{
    $value = '';
    if (!isset($options[$key])) {
        $value = $default;
    } else {
        $value = $options[$key];
    }
    return $value;
}