Skip to:

Opened 9 years ago

Closed 9 years ago

#6214 closed enhancement (fixed)

Don't show "Favorites" menu point if favorites are disabled

Reported by: wpdennis's profile wpdennis Owned by: imath's profile imath
Milestone: 2.3 Priority: normal
Severity: normal Version:
Component: Activity Keywords: has-patch commit


If I disable favorites like this:

add_filter('bp_activity_can_favorite', function() {
    return false;

the favorites menu point under activities is still available. I think it should be removed implicitly, even if there are favorites "from the past". The user experience should be consistent and if I can't favorise something, I shouldn't have a menu point for it.

If someone googles for this and needs a quick solution, this hook removes the menu point:

add_action('bp_activity_setup_nav', function() {
    $bp = buddypress();
    if (isset($bp->bp_options_nav['activity']) and isset($bp->bp_options_nav['activity']['favorites']))

Attachments (1)

6214.patch (3.0 KB) - added by imath 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 @netweb
9 years ago

Related: #bbPress2594 BuddyPress favorites and/or subscription menus still visible when components are disabled

#2 @imath
9 years ago

Thanks for your feedback wpdennis, i agree we should not display the "favorites" navigation elements if the feature is disabled.

I suggest 6214.patch

9 years ago

#3 @imath
9 years ago

  • Keywords has-patch added

#4 @DJPaul
9 years ago

  • Keywords commit added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to 2.3

#5 @imath
9 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 9539:

Only show "Favorites" nav items when favoriting activities is enabled

props wpdennis

Fixes #6214

Note: See TracTickets for help on using tickets.