Changeset 2488 for trunk/bp-groups/bp-groups-templatetags.php
- Timestamp:
- 01/31/2010 12:05:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-templatetags.php
r2471 r2488 171 171 global $groups_template, $bp; 172 172 173 /*** 174 * Set the defaults based on the current page. Any of these will be overridden 175 * if arguments are directly passed into the loop. Custom plugins should always 176 * pass their parameters directly to the loop. 177 */ 178 $type = 'active'; 179 $user_id = false; 180 $page = 1; 181 182 /* User filtering */ 183 if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-groups-scope'] ) 184 $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 185 186 /* Action filtering */ 187 if ( !empty( $_COOKIE['bp-groups-filter'] ) && '-1' != $_COOKIE['bp-groups-filter'] ) 188 $type = $_COOKIE['bp-groups-filter']; 189 190 if ( !empty( $_COOKIE['bp-groups-page'] ) && '-1' != $_COOKIE['bp-groups-page'] ) 191 $page = $_COOKIE['bp-groups-page']; 192 173 193 $defaults = array( 174 'type' => 'active',175 'page' => 1,194 'type' => $type, 195 'page' => $page, 176 196 'per_page' => 20, 177 197 'max' => false, 178 198 179 'user_id' => false, // Pass a user ID to limit to groups this user has joined199 'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined 180 200 'slug' => false, // Pass a group slug to only return that group 181 201 'search_terms' => false // Pass search terms to return only matching groups … … 183 203 184 204 $r = wp_parse_args( $args, $defaults ); 185 extract( $r , EXTR_SKIP);205 extract( $r ); 186 206 187 207 if ( '' == $args ) {
Note: See TracChangeset
for help on using the changeset viewer.