Opened 11 years ago
Closed 11 years ago
#6214 closed enhancement (fixed)
Don't show "Favorites" menu point if favorites are disabled
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.3 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Activity | Keywords: | has-patch commit |
| Cc: |
Description
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']))
unset($bp->bp_options_nav['activity']['favorites']);
});
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Related: #bbPress2594 BuddyPress favorites and/or subscription menus still visible when components are disabled