Redirect after login
-
I have three menus: One for public(10), one for club members(9), one for admin(11). The menu for club members goes first to profile instead of home, but does correctly present menu 9 after exiting the profile . I added the code below to the child functions.php, but the system refuses to save it, complaining that the ‘:’ on line 41 is unexpected. What is wrong here?
function my_wp_nav_menu_args($args = '') { // Logged in menu to display;Public = 10 Menu = 9 Admin = 11 // Public is for non-members Menu is for HFA members Admin is for Admin functions if ( is_user_logged_in() ) { if ( current_user_can( 'activate_plugins' ) ) { $args['menu'] = 11; // admin only menu } else { $args['menu'] = 9; } } else { // Non-logged-in menu to display $args['menu'] = 10; } return $args; } add_filter('wp_nav_menu_args', 'my_wp_nav_menu_args'); function ur_redirect_after_login( $redirect, $user ) { return ‘https://www.hawesfamilyassociation.com’ ; } add_filter( ‘user_registration_login_redirect’, ‘ur_redirect_after_login’, 10, 2 );
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Redirect after login’ is closed to new replies.