Beispiel #1
0
 /**
  * Constructor.
  *
  * @since 3.5
  *
  * @access public
  * @param Membership_Plugin $plugin The instance of the plugin class.
  */
 public function __construct(Membership_Plugin $plugin)
 {
     parent::__construct($plugin);
     $this->_add_action('plugins_loaded', 'register_rules');
     $this->_add_action('plugins_loaded', 'check_membership_status');
     $this->_add_action('template_redirect', 'protect_current_page', 1);
     $this->_add_action('parse_request', 'initialise_protection', 2);
     $this->_add_action('init', 'init_current_member');
     $this->_add_filter('wp_authenticate_user', 'check_membership_is_active_on_signin', 30);
 }
Beispiel #2
0
 /**
  * Constructor.
  *
  * @since 3.5
  *
  * @access public
  * @param Membership_Plugin $plugin The instance of the plugin class.
  */
 public function __construct(Membership_Plugin $plugin)
 {
     parent::__construct($plugin);
     if (defined('DOING_AJAX') && DOING_AJAX) {
         $this->_add_action('wp_ajax_membershipuselevel', 'switch_membership_level');
     } else {
         $this->_add_action('add_admin_bar_menus', 'add_admin_bar_items');
         $this->_add_action('admin_enqueue_scripts', 'enqueue_scripts');
         $this->_add_action('wp_enqueue_scripts', 'enqueue_scripts');
         $this->_add_action('admin_footer', 'print_scripts');
         $this->_add_action('wp_footer', 'print_scripts');
     }
 }
Beispiel #3
0
 /**
  * Constructor.
  *
  * @since 3.5
  *
  * @access public
  * @param Membership_Plugin $plugin The instance of the plugin class.
  */
 public function __construct(Membership_Plugin $plugin)
 {
     parent::__construct($plugin);
     if (is_admin()) {
         //bail if in admin
         return;
     }
     /*
     These aren't really required any more as we have a redirect in place on the
     		registration page itself and can mess up people's menus if they have menu
     		items nested under the registration menu item
     $this->_add_filter( 'wp_get_nav_menu_items', 'filter_nav_menu_items', 10, 3);
     		$this->_add_filter( 'wp_list_pages_excludes', 'filter_wp_list_pages');
     */
 }
Beispiel #4
0
 /**
  * Constructor.
  *
  * @since 3.5
  *
  * @access public
  * @param Membership_Plugin $plugin The instance of the plugin class.
  */
 public function __construct(Membership_Plugin $plugin)
 {
     parent::__construct($plugin);
     $this->_add_filter('body_class', 'add_body_classes');
 }
Beispiel #5
0
 /**
  * Constructor.
  *
  * @since 3.5
  *
  * @access public
  * @param Membership_Plugin $plugin The instance of the plugin class.
  */
 public function __construct(Membership_Plugin $plugin)
 {
     parent::__construct($plugin);
     $this->_add_action('add_meta_boxes');
 }
Beispiel #6
0
 /**
  * Constructor.
  *
  * @since 3.5
  *
  * @access public
  * @param Membership_Plugin $plugin The instance of the plugin class.
  */
 public function __construct(Membership_Plugin $plugin)
 {
     parent::__construct($plugin);
     $this->_add_action('widgets_init', 'register_widgets');
     $this->_add_action('plugins_loaded', 'load_textdomain');
 }
Beispiel #7
0
 /**
  * Constructor.
  *
  * @since 3.5
  *
  * @access public
  * @param Membership_Plugin $plugin The instance of the plugin class.
  */
 public function __construct(Membership_Plugin $plugin)
 {
     parent::__construct($plugin);
     $this->_add_filter('pre_user_first_name', 'get_user_first_name');
     $this->_add_filter('pre_user_last_name', 'get_user_last_name');
 }
Beispiel #8
0
 /**
  * Constructor.
  *
  * @since 3.5
  *
  * @access public
  * @param Membership_Plugin $plugin The instance of the plugin class.
  */
 public function __construct(Membership_Plugin $plugin)
 {
     parent::__construct($plugin);
     $this->_upgrade();
 }