Edit Profile links in the BuddyPress Login Boxes

I installed Multisite Shared Menu Plugin on my website at https://christiangays.com.

Now when I login as “test” and click on the Edit Profile link in my BuddyPress Login box from any of my sub-domains I am taken to https://resources.christiangays.com/bp-members/test/profile/edit/group/1/ or https://chat.christiangays.com/bp-members/test/profile/edit/group/1/ or https://blog.christiangays.com/members/test/profile/edit/group/1/

A warning shows in each case:

Warning: in_array() expects parameter 2 to be array, null given in /home/mary/public_html/mary-content/plugins/buddypress/bp-core/bp-core-filters.php on line 199

The link should go to https://christiangays.com/members/test/profile/edit/group/1/ on all sub-domains.

I do have a mu-plugin/edit-profile-in-login-box.php with the following code

<?php
add_action( 'bp_after_login_widget_loggedin', 'bp_login_profile_edit_link' );
function bp_login_profile_edit_link() {
$target_link = bp_loggedin_user_domain();
echo "<div class='bp-login-widget-user-link cust-bp-edit-profile-link'><a href='".$target_link."profile/edit/'>Edit Profile</a></div>";
}

Can you help me please to make all Edit Profile links in the BuddyPress Login Boxes on ALL sub-domains go to: https://christiangays.com/members/--sububsername--/profile/edit/group/1/

I have contacted Support for the plugin but haven’t heard back and I need this fixed ASAP. It is a live site.

Support Access is granted. Please feel free to make any changes necessary.

  • Nahid
    • Tech Support

    Hey Mary !
    Hope you are having a great day!

    Can you try using the following code inside your mu-plugin/edit-profile-in-login-box.php replacing your previous code? Make sure you have a backup of the previous code at first.

    <?php
    add_action( 'bp_after_login_widget_loggedin', 'bp_login_profile_edit_link' );
    function bp_login_profile_edit_link() {
    global $current_user;
    $username = $current_user->user_login;
    echo "<div class='bp-login-widget-user-link cust-bp-edit-profile-link'><a href='https://christiangays.com/members/".$username."/profile/edit/'>Edit Profile</a></div>";
    }

    Let me know what the results are. Thanks!

    Best,
    Nahid.

  • Mary
    • Wisp of the WP Loop

    Nahid you are wonderful! Thank you so much! This worked perfectly, except that now my Chat page BuddyPress Login Box looks like I'm not logged in, even though I am. It looks like this.

    but it should look like this (only with yellow background)

    Should I open a new ticket for this issue?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.