Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/16/2014 01:05:35 PM (11 years ago)
Author:
boonebgorges
Message:

Introduce bp_activity_show_filters(), and use it for generating dynamic activity filter dropdowns

Activity filter dropdowns were previously hardcoded into templates, with
template-specific hooks for plugins to add their own filter values. This
resulted in an inconsistent and awkward process of maintaining filter lists
between components. The new method introduces new parameters to bp_activity_set_action():
$context (an array of the contexts in which the filter should appear) and
$label (the text that should be used when generating the <option> markup). The
new function bp_activity_show_filter() is then used in the templates to
generate a dynamic list of <option> markup, based on the values registered by
the activity types.

Fixes #5637

Props imath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-activity.php

    r8259 r8428  
    9797        'friendship_accepted',
    9898        __( 'Friendships accepted', 'buddypress' ),
    99         'bp_friends_format_activity_action_friendship_accepted'
     99        'bp_friends_format_activity_action_friendship_accepted',
     100        __( 'Friendships', 'buddypress' ),
     101        array( 'activity', 'member' )
    100102    );
    101103
     
    104106        'friendship_created',
    105107        __( 'New friendships', 'buddypress' ),
    106         'bp_friends_format_activity_action_friendship_created'
     108        'bp_friends_format_activity_action_friendship_created',
     109        __( 'Friendships', 'buddypress' ),
     110        array( 'activity', 'member' )
    107111    );
    108112
Note: See TracChangeset for help on using the changeset viewer.