Support » Plugin: Login Widget With Shortcode » login_redirect filter

  • Login Widget With Shortcode Version 5.6.6

    Can I use the login_redirect filter with your plugin?

    I need to change redirect based on user role, CiviCRM membership, and language.

    At the moment the $user parameter is returning 0

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author


    Please use lwws_login_redirect filter if you want to customize after login redirection using this plugin.

    Thread Starter Cornelia Villeneuve


    Thank you.

    The best solution turned out to be to add the following code into the wp_login add_action

    // check Login Sidebar Widget plugin is active
    if (is_plugin_active('login-sidebar-widget/login.php'))
        add_filter('lwws_login_redirect', array(&$this, "redirectLogin"), 10, 2);

    Where redirectLogin looks like:

    public function redirectLogin($redirect_to, $userID) 
       $user_meta = get_userdata($userID);
       /* add code to determine where to redirect to */
       return $newURL;

    I tried adding the filter on the plugins_loaded action, but it was too early

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘login_redirect filter’ is closed to new replies.