Skip to:
Content

BuddyPress.org

Changeset 8079


Ignore:
Timestamp:
03/08/2014 12:04:36 PM (13 years ago)
Author:
boonebgorges
Message:

In groups widget AJAX handler, use array format to pass params to bp_has_groups()

See #2368

File:
1 edited

Legend:

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

    r7756 r8079  
    170170        }
    171171
    172         if ( bp_has_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?>
     172        $per_page = isset( $_POST['max_groups'] ) ? intval( $_POST['max_groups'] ) : 5;
     173
     174        $groups_args = array(
     175                'type'     => $type,
     176                'per_page' => $per_page,
     177                'max'      => $per_page,
     178        );
     179
     180        if ( bp_has_groups( $groups_args ) ) : ?>
    173181                <?php echo "0[[SPLIT]]"; ?>
    174182                <?php while ( bp_groups() ) : bp_the_group(); ?>
Note: See TracChangeset for help on using the changeset viewer.