Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact
You are here: Home

poof99

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 20, 2018 at 8:26 am in reply to: Initial request to login to view protected content page #14200
    poof99
    Participant

    I am looking to auto redirect non logged in users on a specific page, not the whole site and bypass the default prompt “You need to login to view this content. Please Login. Not a Member? Join Us” and go straight to the login area.

    Make sense??

    April 19, 2018 at 11:55 pm in reply to: Initial request to login to view protected content page #14196
    poof99
    Participant

    I think so. I tweaked the code like so:
    /*** Auto redirect a user who isn’t logged into the site ***/
    add_filter( ‘pre_get_posts’, ‘swpm_auto_redirect_non_members’ );
    function swpm_auto_redirect_non_members() {
    if( !SwpmMemberUtils::is_member_logged_in() && !is_page( array( ‘membership-login’, ‘membership-join’ )) ) {
    wp_redirect( ‘http://test.trustvesta.com/investor-login’ );
    exit;
    }
    }

    BUT the results are that my WordPress login gets broken.
    Do I need to tweak the arry on line 3??

    thank you in advance

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Next Page »

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy