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

    r8345 r8428  
    3333            'new_blog',
    3434            __( 'New site created', 'buddypress' ),
    35             'bp_blogs_format_activity_action_new_blog'
     35            'bp_blogs_format_activity_action_new_blog',
     36            __( 'New Sites', 'buddypress' )
    3637        );
    3738    }
     
    4142        'new_blog_post',
    4243        __( 'New post published', 'buddypress' ),
    43         'bp_blogs_format_activity_action_new_blog_post'
     44        'bp_blogs_format_activity_action_new_blog_post',
     45        __( 'Posts', 'buddypress' ),
     46        array( 'activity', 'member' )
    4447    );
    4548
     
    4851        'new_blog_comment',
    4952        __( 'New post comment posted', 'buddypress' ),
    50         'bp_blogs_format_activity_action_new_blog_comment'
     53        'bp_blogs_format_activity_action_new_blog_comment',
     54        __( 'Comments', 'buddypress' ),
     55        array( 'activity', 'member' )
    5156    );
    5257
Note: See TracChangeset for help on using the changeset viewer.