WordPress.org

Forums

WP-Members: Membership Framework
[resolved] Redirect user to specific pages (5 posts)

  1. CreativeFedora
    Member
    Posted 1 year ago #

    I'm working on a site that has 5 users and want to re-direct each user to respective pages after login. Each user would be re-directed to password protected surveys:

    User 1 => Survey 1
    User 2 => Survey 2
    User 3 => Survey 3
    User 4 => Survey 4
    User 5 => Survey 5

    How do I go about creating this functionality? What available filters can be used to create it?

    http://wordpress.org/plugins/wp-members/

  2. Chad Butler
    Member
    Plugin Author

    Posted 1 year ago #

    If it's just a matter of redirecting on login, you could use the wpmem_login_redirect fitler hook.

    There is a full list of hooks here:
    http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/

  3. CreativeFedora
    Member
    Posted 1 year ago #

    Thanks. I understand and implemented the login redirect for one user, but what I don't understand is how to program to accommodate 5 users that lead to their respective survey pages.

  4. Chad Butler
    Member
    Plugin Author

    Posted 1 year ago #

    You need a conditional process in the redirect function you are hooking to (i.e. if/elseif/else or switch/case). Then redirect based on which user.

  5. CreativeFedora
    Member
    Posted 1 year ago #

    Thanks for pointing me in the right direction. I'm not a PHP programmer and am unfamiliar with much of the coding. Here's where I'm starting off at and need guidance cleaning up the code and using the correct values.

    add_filter( 'wpmem_login_redirect', 'my_login_redirect' );
    
    function my_login_redirect()
    {
    	if(username-a)
    	{
    	return 'http://www.opinionsearchusa.com/2013-ne-la/';
    	}
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Members: Membership Framework
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.