• Hello, the redirect function is fantastic. Is there a way to set a specific users home page (homeurl)? I would like to show different users a different home page, currently the login re-direct works for the first time they login, but when they hit the Home button, it takes them back to the main site’s URL and not their re-directed login URL.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Peter, I also want to know the solution for this.
    Once login, the “Visit my site” URL should be rewritten with the “redirect” URL assigned for the user.

    You’d have to modify the homeurl() functionality: https://wordpress.stackexchange.com/questions/298965/change-admin-bar-visit-site-url

    Then you could use the redirect_to_front_page() function to return the correct URL.

    Peter, I tried this, but the “Visit site” becomes unclickable.

    // Create submenu items.

    if ( is_admin() ) {
    // Add an option to visit the site.
    $wp_admin_bar->add_menu(
    array(
    ‘parent’ => ‘site-name’,
    ‘id’ => ‘view-site’,
    ‘title’ => __( ‘Visit Site’ ),
    ‘href’ => redirect_to_front_page(), <—- doesn’t work. Do I have to define it somewhere?
    )
    );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set user specific homeurl?’ is closed to new replies.