Changeset 13236
- Timestamp:
- 02/18/2022 11:06:15 PM (3 years ago)
- Location:
- trunk/src/bp-blogs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-functions.php
r13184 r13236 1254 1254 * @see BP_Blogs_Blog::get() for a description of parameters and return values. 1255 1255 * 1256 * @param int|null $ limitSee {@BP_Blogs_Blog::get()}.1256 * @param int|null $per_page See {@BP_Blogs_Blog::get()}. 1257 1257 * @param int|null $page See {@BP_Blogs_Blog::get()}. 1258 1258 * @return array See {@BP_Blogs_Blog::get()}. 1259 1259 */ 1260 function bp_blogs_get_random_blogs( $ limit= null, $page = null ) {1260 function bp_blogs_get_random_blogs( $per_page = null, $page = null ) { 1261 1261 return BP_Blogs_Blog::get( 1262 1262 array( 1263 'type' => 'random',1264 ' limit' => $limit,1265 'page' => $page1263 'type' => 'random', 1264 'per_page' => $per_page, 1265 'page' => $page 1266 1266 ) 1267 1267 ); -
trunk/src/bp-blogs/classes/class-bp-blogs-blog.php
r13184 r13236 171 171 * @type string $type The order in which results should be returned. 172 172 * 'active', 'alphabetical', 'newest', or 'random'. 173 * @type int|bool $ limit Optional. The maximum records to return.173 * @type int|bool $per_page Optional. The number of records to return per page. 174 174 * Default: false. 175 175 * @type int|bool $page Optional. The page of records to return. … … 201 201 $old_args_keys = [ 202 202 0 => 'type', 203 1 => ' limit',203 1 => 'per_page', 204 204 2 => 'page', 205 205 3 => 'user_id', … … 218 218 array( 219 219 'type' => 'active', 220 ' limit'=> false,220 'per_page' => false, 221 221 'page' => false, 222 222 'user_id' => 0, … … 234 234 } 235 235 236 $pag_sql = ( $r[' limit'] && $r['page'] ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $r['page'] - 1 ) * $r['limit']), intval( $r['limit'] ) ) : '';236 $pag_sql = ( $r['per_page'] && $r['page'] ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $r['page'] - 1 ) * $r['per_page']), intval( $r['per_page'] ) ) : ''; 237 237 238 238 $user_sql = ! empty( $r['user_id'] ) ? $wpdb->prepare( " AND b.user_id = %d", $r['user_id'] ) : '';
Note: See TracChangeset
for help on using the changeset viewer.