Tagged: bp redirect to profile
Hi,
Thank you for using the plugin.Please disable it and use the following code(in plugins/bp-custom.php or your theme’s functions.php)
/** * Redirect user to their profile if they are not admin. * * @param string $redirect_to_calculated calculated redirect. * @param string $redirect_url_specified specified redirect. * @param WP_User $user user. * * @return string */ function bpdev_custom_redirect_to_profile( $redirect_to_calculated, $redirect_url_specified, $user ) { if ( ! $user || is_wp_error( $user ) ) { return $redirect_to_calculated; } // If the redirect is not specified, assume it to be dashboard. if ( empty( $redirect_to_calculated ) ) { $redirect_to_calculated = admin_url(); } // if the user is not site admin, redirect to his/her profile. if ( function_exists( 'bp_core_get_user_domain' ) && ! is_super_admin( $user->ID ) ) { return bp_core_get_user_domain( $user->ID ) . bp_get_activity_slug() . '/following/'; } // if site admin or not logged in, do not do anything much. return $redirect_to_calculated; } add_filter( 'login_redirect', 'bpdev_custom_redirect_to_profile', 101, 3 );
Regards
BrajeshHi bonga,
Please recheck and make sure you copy the code form forum post not from forum notification mail.
The code is working for me. I tested it again today to confirm it works. I am assuming you are using the 1.3-alpha of BuddyPress follow from github.
Regards
Brajesh
Viewing 6 posts - 1 through 6 (of 6 total)
The topic ‘ [Resolved] buddypress 'following'’ is closed to new replies.
This topic is: resolved