Changeset 10767 for trunk/src/bp-groups/bp-groups-template.php
- Timestamp:
- 05/15/2016 02:30:51 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-template.php
r10766 r10767 107 107 * @param array|string $args { 108 108 * Array of parameters. All items are optional. 109 * @type string $type Shorthand for certain orderby/ 110 * order combinations. 'newest', 111 * 'active', 'popular', 'alphabetical', 112 * 'random'. When present, will override 113 * orderby and order params. Default: null. 114 * @type string $order Sort order. 'ASC' or 'DESC'. 115 * Default: 'DESC'. 116 * @type string $orderby Property to sort by. 117 * 'date_created', 'last_activity', 'total_member_count', 118 * 'name', 'random'. Default: 'last_activity'. 119 * @type int $page Page offset of results to return. 120 * Default: 1 (first page of results). 121 * @type int $per_page Number of items to return per page 122 * of results. Default: 20. 123 * @type int $max Does NOT affect query. May change the 124 * reported number of total groups found, 125 * but not the actual number of found 126 * groups. Default: false. 127 * @type bool $show_hidden Whether to include hidden groups in 128 * results. Default: false. 129 * @type string $page_arg Query argument used for pagination. 130 * Default: 'grpage'. 131 * @type int $user_id If provided, results will be limited 132 * to groups of which the specified user 133 * is a member. 134 * Default: value of bp_displayed_user_id(). 135 * @type string $slug If provided, only the group with the 136 * matching slug will be returned. 137 * Default: false. 138 * @type string $search_terms If provided, only groups whose names or 139 * descriptions match the search terms will 140 * be returned. Default: value of 141 * `$_REQUEST['groups_search']` or 142 * `$_REQUEST['s']`, if present. Otherwise false. 109 * @type string $type Shorthand for certain orderby/order combinations. 'newest', 'active', 110 * 'popular', 'alphabetical', 'random'. When present, will override 111 * orderby and order params. Default: null. 112 * @type string $order Sort order. 'ASC' or 'DESC'. Default: 'DESC'. 113 * @type string $orderby Property to sort by. 'date_created', 'last_activity', 114 * 'total_member_count', 'name', 'random'. Default: 'last_activity'. 115 * @type int $page Page offset of results to return. Default: 1 (first page of results). 116 * @type int $per_page Number of items to return per page of results. Default: 20. 117 * @type int $max Does NOT affect query. May change the reported number of total groups 118 * found, but not the actual number of found groups. Default: false. 119 * @type bool $show_hidden Whether to include hidden groups in results. Default: false. 120 * @type string $page_arg Query argument used for pagination. Default: 'grpage'. 121 * @type int $user_id If provided, results will be limited to groups of which the specified 122 * user is a member. Default: value of bp_displayed_user_id(). 123 * @type string $slug If provided, only the group with the matching slug will be returned. 124 * Default: false. 125 * @type string $search_terms If provided, only groups whose names or descriptions match the search 126 * terms will be returned. Default: value of `$_REQUEST['groups_search']` or 127 * `$_REQUEST['s']`, if present. Otherwise false. 143 128 * @type array|string $group_type Array or comma-separated list of group types to limit results to. 144 129 * @type array|string $group_type__in Array or comma-separated list of group types to limit results to. 145 130 * @type array|string $group_type__not_in Array or comma-separated list of group types that will be 146 131 * excluded from results. 147 * @type array $meta_query An array of meta_query conditions. 148 * See {@link WP_Meta_Query::queries} for description. 149 * @type array|string $include Array or comma-separated list of 150 * group IDs. Results will be limited 151 * to groups within the list. Default: false. 152 * @type bool $populate_extras Whether to fetch additional information 153 * (such as member count) about groups. 154 * Default: true. 155 * @type array|string $exclude Array or comma-separated list of group IDs. 156 * Results will exclude the listed groups. 157 * Default: false. 158 * @type bool $update_meta_cache Whether to fetch groupmeta for queried groups. 159 * Default: true. 132 * @type array $meta_query An array of meta_query conditions. 133 * See {@link WP_Meta_Query::queries} for description. 134 * @type array|string $include Array or comma-separated list of group IDs. Results will be limited 135 * to groups within the list. Default: false. 136 * @type bool $populate_extras Whether to fetch additional information (such as member count) 137 * about groups. Default: true. 138 * @type array|string $exclude Array or comma-separated list of group IDs. Results will exclude 139 * the listed groups. Default: false. 140 * @type bool $update_meta_cache Whether to fetch groupmeta for queried groups. Default: true. 160 141 * } 161 142 * @return bool True if there are groups to display that match the params … … 201 182 // Parse defaults and requested arguments. 202 183 $r = bp_parse_args( $args, array( 203 'type' => $type,204 'order' => 'DESC',205 'orderby' => 'last_activity',206 'page' => 1,207 'per_page' => 20,208 'max' => false,209 'show_hidden' => false,210 'page_arg' => 'grpage',211 'user_id' => bp_displayed_user_id(),212 'slug' => $slug,213 'search_terms' => $search_terms,184 'type' => $type, 185 'order' => 'DESC', 186 'orderby' => 'last_activity', 187 'page' => 1, 188 'per_page' => 20, 189 'max' => false, 190 'show_hidden' => false, 191 'page_arg' => 'grpage', 192 'user_id' => bp_displayed_user_id(), 193 'slug' => $slug, 194 'search_terms' => $search_terms, 214 195 'group_type' => '', 215 196 'group_type__in' => '', 216 197 'group_type__not_in' => '', 217 'meta_query' => false,218 'include' => false,219 'exclude' => false,220 'populate_extras' => true,221 'update_meta_cache' => true,198 'meta_query' => false, 199 'include' => false, 200 'exclude' => false, 201 'populate_extras' => true, 202 'update_meta_cache' => true, 222 203 ), 'has_groups' ); 223 204 224 205 // Setup the Groups template global. 225 206 $groups_template = new BP_Groups_Template( array( 226 'type' => $r['type'],227 'order' => $r['order'],228 'orderby' => $r['orderby'],229 'page' => (int) $r['page'],230 'per_page' => (int) $r['per_page'],231 'max' => (int) $r['max'],232 'show_hidden' => $r['show_hidden'],233 'page_arg' => $r['page_arg'],234 'user_id' => (int) $r['user_id'],235 'slug' => $r['slug'],236 'search_terms' => $r['search_terms'],207 'type' => $r['type'], 208 'order' => $r['order'], 209 'orderby' => $r['orderby'], 210 'page' => (int) $r['page'], 211 'per_page' => (int) $r['per_page'], 212 'max' => (int) $r['max'], 213 'show_hidden' => $r['show_hidden'], 214 'page_arg' => $r['page_arg'], 215 'user_id' => (int) $r['user_id'], 216 'slug' => $r['slug'], 217 'search_terms' => $r['search_terms'], 237 218 'group_type' => $r['group_type'], 238 219 'group_type__in' => $r['group_type__in'], 239 220 'group_type__not_in' => $r['group_type__not_in'], 240 'meta_query' => $r['meta_query'],241 'include' => $r['include'],242 'exclude' => $r['exclude'],243 'populate_extras' => (bool) $r['populate_extras'],244 'update_meta_cache' => (bool) $r['update_meta_cache'],221 'meta_query' => $r['meta_query'], 222 'include' => $r['include'], 223 'exclude' => $r['exclude'], 224 'populate_extras' => (bool) $r['populate_extras'], 225 'update_meta_cache' => (bool) $r['update_meta_cache'], 245 226 ) ); 246 227
Note: See TracChangeset
for help on using the changeset viewer.