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-xprofile/bp-xprofile-activity.php

    r8306 r8428  
    2222        // see r4273
    2323        'profile',
    24 
    2524        'new_avatar',
    2625        __( 'Member changed profile picture', 'buddypress' ),
    27         'bp_xprofile_format_activity_action_new_avatar'
     26        'bp_xprofile_format_activity_action_new_avatar',
     27        __( 'Updated Avatars', 'buddypress' )
    2828    );
    2929
     
    3232        'new_member',
    3333        __( 'New member registered', 'buddypress' ),
    34         'bp_xprofile_format_activity_action_new_member'
     34        'bp_xprofile_format_activity_action_new_member',
     35        __( 'New Members', 'buddypress' ),
     36        array( 'activity' )
    3537    );
    3638
     
    3941        'updated_profile',
    4042        __( 'Updated Profile', 'buddypress' ),
    41         'bp_xprofile_format_activity_action_updated_profile'
     43        'bp_xprofile_format_activity_action_updated_profile',
     44        __( 'Profile Updates', 'buddypress' ),
     45        array( 'activity' )
    4246    );
    4347
     
    310314 *
    311315 * @since BuddyPress (2.0.0)
     316 * @todo Mark as deprecated
    312317 */
    313318function xprofile_activity_filter_options() {
     
    318323    <?php
    319324}
    320 add_action( 'bp_activity_filter_options', 'xprofile_activity_filter_options' );
Note: See TracChangeset for help on using the changeset viewer.