Skip to:
Content

BuddyPress.org

Changeset 3521


Ignore:
Timestamp:
12/05/2010 09:57:09 PM (9 years ago)
Author:
boonebgorges
Message:

Specifies a filtered user_id for groups widget for more predictable results. Fixes #2368

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-widgets.php

    r3477 r3521  
    2424    function widget( $args, $instance ) {
    2525        global $bp;
     26       
     27        $user_id = apply_filters( 'bp_group_widget_user_id', '0' );
    2628
    27         extract( $args );
     29        extract( $args );
    2830
    2931        if ( !$instance['group_default'] )
     
    3537           . $after_title; ?>
    3638
    37         <?php if ( bp_has_groups( 'type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] ) ) : ?>
     39        <?php if ( bp_has_groups( 'user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] ) ) : ?>
    3840            <div class="item-options" id="groups-list-options">
    3941                <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a> |
Note: See TracChangeset for help on using the changeset viewer.