예제 #1
0
function st_theme_activate()
{
    // update_option(ST_SETTINGS_OPTION,$options);
    st_update_default_settings(true);
    ob_start();
    //  header('Location: '.admin_url('admin.php?page='.ST_PAGE_SLUG));
}
예제 #2
0
<?php

global $tabs_settings, $pagenow;
$st_default_lang_code = get_bloginfo('language');
// DO NOT REMOVE
if (isset($_REQUEST['to_default']) && $_REQUEST['to_default'] == 1) {
    st_update_default_settings();
}
if (isset($_POST['save']) && $_POST['save'] == 'Y') {
    $data = array();
    $count = 0;
    foreach ($_POST as $key => $arr) {
        if (strpos($key, ST_SETTINGS_OPTION) !== false) {
            $k = str_replace(ST_SETTINGS_OPTION . '_', '', $key);
            $data[$k] = $arr;
        }
    }
    if (st_is_wpml()) {
        // ICL_LANGUAGE_CODE
        //  echo var_dump($st_default_lang_code,ICL_LANGUAGE_CODE);
        if ($st_default_lang_code == ICL_LANGUAGE_CODE || ICL_LANGUAGE_CODE == '' || strpos($st_default_lang_code, ICL_LANGUAGE_CODE) !== false) {
            // update_option(ST_FRAMEWORK_SETTINGS_OPTION,$_POST[ST_FRAMEWORK_SETTINGS_OPTION]);
            update_option(ST_SETTINGS_OPTION, $data);
        }
        update_option(ST_SETTINGS_OPTION . '_' . ICL_LANGUAGE_CODE, $data);
        do_action('st_save_options', $data);
    } else {
        update_option(ST_SETTINGS_OPTION, $data);
        do_action('st_save_options', $data);
    }
    flush_rewrite_rules();