[buddypress-trac] [BuddyPress Trac] #5938: BP Activity Hooks Documentation

buddypress-trac noreply at wordpress.org
Tue Nov 11 04:06:13 UTC 2014


#5938: BP Activity Hooks Documentation
--------------------+-----------------------------
 Reporter:  tw2113  |       Owner:
     Type:  task    |      Status:  new
 Priority:  normal  |   Milestone:  Future Release
Component:  Core    |     Version:
 Severity:  normal  |  Resolution:
 Keywords:          |
--------------------+-----------------------------

Comment (by tw2113):

 Naturally, the last hook I have, is a bit odd. :)


 {{{
 bp_get_activity_show_filters
 }}}

 We currently have the following, with a different argument list passed for
 both cases.

 {{{
 /**
  * Filters the options available in the activity filter dropdown.
  *
  * @since BuddyPress (2.1.0)
  *
  * @param array $filters Array of filter options for the given context, in
 the following format: $option_value => $option_name
  * @param string $context Context for the filter. 'activity', 'member',
 'member_groups', 'group'.
  */
 $filters = apply_filters( 'bp_get_activity_show_filters', $filters,
 $context );

 // Build the options output
 $output = '';

 if ( ! empty( $filters ) ) {
         foreach ( $filters as $value => $filter ) {
                 $output .= '<option value="' . esc_attr( $value ) . '">' .
 esc_html( $filter ) . '</option>' . "\n";
         }
 }

 return apply_filters( 'bp_get_activity_show_filters', $output, $filters,
 $context );
 }}}

 Not sure if you, once again, want to try and normalize the parameters, or
 have an idea for a different solution.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5938#comment:16>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list