Esempio n. 1
0
function reg_set_p()
{
    register_setting('pasw2015_options', 'pasw_social');
    register_setting('pasw2015_options', 'pasw_email_scuola');
    register_setting('pasw2015_options', 'pasw_recapito_scuola');
    register_setting('pasw2015_options', 'pasw_indirizzo_scuola');
    register_setting('pasw2015_options', 'pasw_fluid_width');
    register_setting('pasw2015_options', 'pasw_loghi_footer');
    register_setting('pasw2015_options', 'pasw_logo');
    add_option('pasw2015_version');
    if (version_compare(get_option('pasw2015_version'), get_pasw2015_version(), "<")) {
        update_option('pasw2015_version', get_pasw2015_version());
        wp_safe_redirect(admin_url('/admin.php?page=pasw2015', 'http'), 301);
    }
}
Esempio n. 2
0
function reg_set_p()
{
    require get_template_directory() . '/include/moduli-pasw2015.php';
    register_setting('pasw2015_options', 'pasw_social');
    register_setting('pasw2015_options', 'pasw_email_scuola');
    register_setting('pasw2015_options', 'pasw_pec_scuola');
    register_setting('pasw2015_options', 'pasw_recapito_scuola');
    register_setting('pasw2015_options', 'pasw_indirizzo_scuola');
    register_setting('pasw2015_options', 'pasw_fluid_width');
    register_setting('pasw2015_options', 'pasw_loghi_footer');
    register_setting('pasw2015_options', 'pasw_testo_footer');
    register_setting('pasw2015_options', 'pasw_secondo_menu');
    register_setting('pasw2015_options', 'pasw_menu_login');
    register_setting('pasw2015_options', 'pasw_ga_id');
    register_setting('pasw2015_options', 'pasw_ga_profile_id');
    register_setting('pasw2015_options', 'pasw_ga_user');
    register_setting('pasw2015_options', 'pasw_key');
    register_setting('pasw2015_options', 'pasw_ga_password');
    register_setting('pasw2015_options', 'pasw_logo');
    register_setting('pasw2015_options', 'pasw_submenu', 'intval');
    register_setting('pasw2015_functions', 'pasw_mcolumn', 'intval');
    register_setting('pasw2015_functions', 'pasw_catpage', 'intval');
    register_setting('pasw2015_functions', 'pasw_taxdest', 'intval');
    register_setting('pasw2015_functions', 'pasw_msidebar', 'intval');
    if (!get_option('pasw_key')) {
        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $randomString = '';
        for ($i = 0; $i < 10; $i++) {
            $randomString .= $characters[rand(0, strlen($characters) - 1)];
        }
        update_option('pasw_key', $randomString);
        if (-1 != get_option('page_on_front')) {
            update_post_meta(get_option('page_on_front'), '_wp_page_template', 'tmpl_home.php');
        }
        // end if
    }
    add_option('pasw2015_version');
    if (version_compare(get_option('pasw2015_version'), get_pasw2015_version(), "<")) {
        if (get_option('pasw2015_version') == '') {
            update_option('pasw_logo', get_bloginfo("template_url") . '/images/repubblica-italiana.png');
        }
        update_option('pasw2015_version', get_pasw2015_version());
        update_option('pasw2015_versionalert', get_pasw2015_version());
        delete_option('pasw_favicon');
        wpgov_update();
        wp_safe_redirect(admin_url('/admin.php?page=pasw2015', 'http'), 301);
    }
}