/**
  * Prepare for Member registration.
  *
  * @since  1.0.0
  */
 public function __construct()
 {
     parent::__construct();
     if (MS_Plugin::is_enabled()) {
         do_action('ms_controller_frontend_construct', $this);
         // Process actions like register new account.
         $this->add_action('template_redirect', 'process_actions', 1);
         // Check if the current page is a Membership Page.
         $this->add_action('template_redirect', 'check_for_membership_pages', 2);
         // Propagates SSL cookies when user logs in.
         $this->add_action('wp_login', 'propagate_ssl_cookie', 10, 2);
         // Enqueue scripts.
         $this->add_action('wp_enqueue_scripts', 'enqueue_scripts');
         // Add classes for all memberships the user is registered to.
         $this->add_filter('body_class', 'body_class');
         // Clears the shortcode memory at the beginning of the_content
         $this->add_filter('the_content', 'clear_content_memory', 1);
         // Compact code for output on the front end.
         add_filter('ms_compact_code', array('MS_Helper_Html', 'compact_code'));
         /**
          * This allows WordPress to provide the default register form.
          *
          * Set the filter response to FALSE to stop Membership2 from
          * handling the registration process. WordPress or other plugins can
          * register users in that case.
          *
          * @since  1.0.0
          */
         self::$handle_registration = apply_filters('ms_frontend_handle_registration', true);
         if (self::$handle_registration) {
             // Set the registration URL to the 'Register' Membership Page.
             $this->add_filter('wp_signup_location', 'signup_location', 999);
             $this->add_filter('register_url', 'signup_location', 999);
         }
         // Redirect users to their Account page after login.
         $this->add_filter('login_redirect', 'login_redirect', 10, 3);
     }
 }