function wangguard_init()
{
    // global $wangguard_api_key , $wangguard_api_port , $wangguard_api_host , $wangguard_rest_path;
    global $wangguard_api_key;
    $wangguard_api_key = get_site_option('wangguard_api_key');
    //$wangguard_api_host = 'rest.wangguard.com';
    //$wangguard_rest_path = '/';
    //$wangguard_api_port = 80;
    if (function_exists('load_plugin_textdomain')) {
        $plugin_dir = basename(dirname(__FILE__));
        load_plugin_textdomain('wangguard', false, $plugin_dir . "/languages/");
    }
    if (get_site_option("wangguard-enable-bp-report-btn") == 1 && defined('BP_VERSION') || get_site_option("wangguard-enable-bp-report-blog") == 1) {
        wp_enqueue_script("jquery");
    }
    if (get_site_option('wangguard_disable-meta-header') == 1) {
        remove_action('wp_head', 'wp_generator');
    }
    if (get_site_option("wangguard-do-not-show-adminbar") == 1 && defined('BP_VERSION')) {
        remove_action('bp_adminbar_menus', 'wangguard_add_bp_admin_bar_menus', 10);
        remove_action('admin_bar_menu', 'wangguard_add_wp_admin_bar_menus', 100);
    }
    if (get_site_option("wangguard-do-not-show-adminbar") == 1 && !defined('BP_VERSION')) {
        remove_action('admin_bar_menu', 'wangguard_add_wp_admin_bar_menus', 100);
        wangguard_admin_warnings();
    }
}
Esempio n. 2
0
function wangguard_init()
{
    global $wangguard_api_key, $wangguard_api_port, $wangguard_api_host, $wangguard_rest_path;
    $wangguard_api_key = wangguard_get_option('wangguard_api_key');
    $wangguard_api_host = 'rest.wangguard.com';
    $wangguard_rest_path = '/';
    $wangguard_api_port = 80;
    if (function_exists('load_plugin_textdomain')) {
        $plugin_dir = basename(dirname(__FILE__));
        load_plugin_textdomain('wangguard', false, $plugin_dir . "/languages/");
    }
    if (wangguard_get_option("wangguard-enable-bp-report-btn") == 1 || wangguard_get_option("wangguard-enable-bp-report-blog") == 1) {
        wp_enqueue_script("jquery");
    }
    if (wangguard_get_option('wangguard_disable-meta-header') == 1) {
        remove_action('wp_head', 'wp_generator');
    }
    wangguard_admin_warnings();
}