/** * Register callbacks for actions and filters * */ public function register_hook_callbacks() { WPBRS_Actions_Filters::add_action('wpmu_new_blog', $this, 'activate_new_site'); WPBRS_Actions_Filters::add_action('plugins_loaded', $this, 'load_plugin_textdomain'); register_activation_hook(WP_Block_Referrer_Spam::$plugin_path . WP_Block_Referrer_Spam::PLUGIN_ID . '.php', array($this, 'activate')); register_deactivation_hook(WP_Block_Referrer_Spam::$plugin_path . WP_Block_Referrer_Spam::PLUGIN_ID . '.php', array($this, 'deactivate')); }
/** * Register callbacks for actions and filters * * @since 1.0 */ protected function register_hook_callbacks() { WPBRS_Actions_Filters::add_action('admin_menu', $this, 'plugin_menu'); WPBRS_Actions_Filters::add_action('admin_print_scripts-' . self::$hook_suffix, $this, 'enqueue_scripts'); WPBRS_Actions_Filters::add_action('load-' . self::$hook_suffix, $this, 'register_fields'); WPBRS_Actions_Filters::add_action('wp_ajax_wpbrs_reset_list', $this, 'ajax_wpbrs_reset_list_callback'); WPBRS_Actions_Filters::add_filter('plugin_action_links_' . WP_Block_Referrer_Spam::PLUGIN_ID . '/' . WP_Block_Referrer_Spam::PLUGIN_ID . '.php', $this, 'add_plugin_action_links'); }
/** * Register callbacks for actions and filters * * @since 1.0 */ protected function register_hook_callbacks() { WPBRS_Actions_Filters::add_action('admin_notices', $this, 'show_admin_notices'); }
/** * Define the core functionality of the plugin. * * Load the dependencies, define the locale, and set the hooks for the admin area and * the public-facing side of the site. * * @since 1.0 */ public function __construct() { self::$plugin_path = plugin_dir_path(dirname(__FILE__)); require_once self::$plugin_path . 'includes/' . self::PLUGIN_PREFIX . 'loader.php'; self::$modules['WPBRS_Loader'] = WPBRS_Loader::get_instance(); self::$modules['WPBRS_Controller_Settings'] = WPBRS_Controller_Settings::get_instance(); self::$modules['WPBRS_Controller_Blocker'] = WPBRS_Controller_Blocker::get_instance(); self::$modules['WPBRS_Controller_Cron'] = WPBRS_Controller_Cron::get_instance(); self::$modules['WPBRS_Controller_Admin_Notices'] = WPBRS_Controller_Admin_Notices::get_instance(); WPBRS_Actions_Filters::init_actions_filters(); }
/** * Register callbacks for actions and filters * * @since 1.0 */ protected function register_hook_callbacks() { WPBRS_Actions_Filters::add_action('check_referrers_updates', $this, 'check_referrers_updates_cron_job'); WPBRS_Actions_Filters::add_action('cron_schedules', __CLASS__, 'add_custom_cron_intervals'); }
/** * Register the filters and actions with WordPress. * * @since 1.0 */ public static function init_actions_filters() { if (!isset(self::$filters)) { self::$filters = array(); } if (!isset(self::$actions)) { self::$actions = array(); } foreach (self::$filters as $hook) { add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); } foreach (self::$actions as $hook) { add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); } }
/** * Register callbacks for actions and filters * * @since 1.0 */ protected function register_hook_callbacks() { WPBRS_Actions_Filters::add_action('init', $this, 'filter_referrers_no_htaccess', 0, 0); }
/** * Register callbacks for actions and filters * * @since 1.0 */ protected function register_hook_callbacks() { WPBRS_Actions_Filters::add_action('admin_init', $this, 'register_settings'); }