/** * Registers the necessary plugin hooks with NXTClass. */ public function __construct() { parent::__construct(); // Adds a link to sign up for a Gravatar account to the welcome email add_filter('update_welcome_email', array($this, '_update_new_blog_email'), 100, 6); add_filter('update_welcome_user_email', array($this, '_update_new_user_email'), 100, 4); }
/** * Register hooks to preventing commenting. */ function __construct() { parent::__construct(); // Apply filters to disable comments on any pages or posts on the site if ($this->get_option('comments_disabled')) { add_filter('comments_open', array($this, '_always_show_comments_as_closed'), 10, 2); if (!is_admin()) { add_filter('the_posts', array($this, '_close_comment_status_on_posts')); } } }
/** * Registers NXTClass hooks to enable the student blog list widget. */ function __construct() { parent::__construct(); add_action('widgets_init', array($this, '_enable_widget')); }
/** * Registers NXTClass hooks to enable the word counter. */ function __construct() { parent::__construct(); add_action('nxt_dashboard_setup', array($this, '_add_student_dashboard_widget')); }
/** * Registers plugin hooks once all plugins have loaded. */ function __construct() { parent::__construct(); add_action('plugins_loaded', array($this, '_register_hooks')); }
/** * Registers the necessary plugin hooks with NXTClass. */ public function __construct() { parent::__construct(); // Update a user's info when they are added add_action('user_register', array($this, '_update_user_info')); }
/** * Resolve the sitewide table names on startup. */ public function __construct() { parent::__construct(); $this->sw_tables = ClassBlogs_Plugins_Aggregation_Settings::get_table_names(); }
/** * Registers the necessary NXTClass hooks to make the playlist work. */ public function __construct() { parent::__construct(); $this->tables = $this->_make_table_names(); // Register hooks for finding videos in post content and for showing the // playlist archive page add_action('deleted_post', array($this, '_update_videos_on_post_delete')); add_action('save_post', array($this, '_update_videos_on_post_save')); add_action('widgets_init', array($this, '_enable_widget')); add_action('nxt_enqueue_scripts', array($this, '_add_playlist_page_scripts')); // Make the playlist shortcode available add_shortcode(self::_PLAYLIST_SHORTCODE, array($this, '_render_playlist_page')); }
/** * Initialize common admin options and provide a hook for plugins to * perform further configuration options. */ public function __construct() { // Configure cache-clearing listeners if they have yet to be loaded if (!self::$_site_cache_listeners_enabled) { $this->_enable_site_cache_listeners(); self::$_site_cache_listeners_enabled = true; } // Provide plugins with the option of enabling an admin page if (is_admin()) { add_action('admin_footer', array($this, '_add_admin_js')); add_action('admin_head', array($this, '_add_admin_css')); add_action('admin_menu', array($this, '_maybe_enable_admin_page')); } }