r-a-y / buddypress-followers

Follow users on your BuddyPress site. Similar to Twitter!
http://wordpress.org/plugins/buddypress-followers/
74 stars 39 forks source link

How to move follow menu items from the member submenu to the profile submenu? #101

Closed rgilman closed 5 years ago

rgilman commented 5 years ago

I working on simplifying the BuddyPress member submenu and moving some menu items one step down the hierarchy. In particular, I'd like to move the Following and Followers menu items into the Profile component submenu.

So far I've had success adding those items to the Profile submenu but I have to use $user_domain for the parent_url (rather than $user_domain . 'profile') and if I remove the menu items from the Member submenu with bp_core_remove_nav_item() I get 404s.

Any clues for how to complete the move from the member submenu to the profile submenu would be welcome. I'm particularly stumped about the changes I need to make so the screen function will work from the new menu location.

Thanks!

r-a-y commented 5 years ago

Thanks for the report, @rgilman.

This doesn't seem to be a bug, but custom functionality so I'm going to close this.

I'll give you a hint though if you're using master branch. I added conditional loading in master branch, so you need to ensure that the screen loader function is available when you change the nav's parent_url.

See: https://github.com/r-a-y/buddypress-followers/blob/master/bp-follow-core.php#L96

Since you changed the parent_url, the "is follow" conditional probably no longer works, so you'll have to manually load up the actions.php and screens.php files when on your custom follow page.

Hope that helps. Feel free to continue replying.