Reply To: Another user’s edit page jumps to the profile page
All right so you have above defined 4 links. 4 subpages and we want to redirect redirect them to user profile main page.
We need to use hook to redirect those pages
add_action( 'template_redirect', 'redirect_user_to_profile_from_subpages' );
function redirect_user_to_profile_from_subpages() {
global $wp;
// subpage - enagements
if ($wp->query_vars["bbp_engagements"] == 1 ) {
wp_safe_redirect( bbp_get_user_profile_url( get_current_user_id() ) );
exit;
}
// subpage - topics created
if (bbp_is_topics_created()) {
wp_safe_redirect( bbp_get_user_profile_url( get_current_user_id() ) );
exit;
}
// subpage - replies created
if (bbp_is_replies_created()) {
wp_safe_redirect( bbp_get_user_profile_url( get_current_user_id() ) );
exit;
}
// subpage - subscriptions
if (bbp_is_subscriptions()) {
wp_safe_redirect( bbp_get_user_profile_url( get_current_user_id() ) );
exit;
}
}
Let me know if this works for you.