static function init() { GMW_tracking::init(); if (is_admin()) { // check if minimal required WP version is used self::check_wp_version(3.3); // check some variables self::upgrade(); // aditional links in plugin description add_filter('plugin_action_links_' . basename(dirname(__FILE__)) . '/' . basename(__FILE__), array(__CLASS__, 'plugin_action_links')); add_filter('plugin_row_meta', array(__CLASS__, 'plugin_meta_links'), 10, 2); // enqueue admin scripts add_action('admin_enqueue_scripts', array(__CLASS__, 'admin_enqueue_scripts')); add_action('customize_controls_enqueue_scripts', array(__CLASS__, 'admin_enqueue_scripts')); // JS dialog markup add_action('admin_footer', array(__CLASS__, 'admin_dialogs_markup')); // register AJAX endpoints add_action('wp_ajax_gmw_subscribe', array(__CLASS__, 'email_subscribe')); add_action('wp_ajax_gmw_activate', array(__CLASS__, 'activate_via_code')); // handle dismiss button for all notices add_action('admin_action_gmw_dismiss_notice', array(__CLASS__, 'dismiss_notice')); // display various notices self::add_notices(); } else { // enqueue frontend scripts add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts')); add_action('wp_footer', array(__CLASS__, 'dialogs_markup')); } // add shortcode support self::add_shortcode(); }
static function init() { GMW_tracking::init(); if (is_admin()) { // check if minimal required WP version is used self::check_wp_version(3.3); self::upgrade(); // aditional links in plugin description add_filter('plugin_action_links_' . basename(dirname(__FILE__)) . '/' . basename(__FILE__), array(__CLASS__, 'plugin_action_links')); add_filter('plugin_row_meta', array(__CLASS__, 'plugin_meta_links'), 10, 2); // enqueue admin scripts add_action('admin_enqueue_scripts', array(__CLASS__, 'admin_enqueue_scripts')); add_action('customize_controls_enqueue_scripts', array(__CLASS__, 'admin_enqueue_scripts')); } else { // enqueue frontend scripts add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts')); add_action('wp_footer', array(__CLASS__, 'dialogs_markup')); } }