Skip to:
Content

BuddyPress.org

Changeset 2702 for trunk/bp-blogs.php


Ignore:
Timestamp:
02/12/2010 02:14:20 PM (16 years ago)
Author:
apeatling
Message:

Fixing up API so it is consistent for get_users, get_groups and get_blogs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r2698 r2702  
    313313 * true or false on success or failure.
    314314 */
     315
     316function bp_blogs_get_blogs( $args = '' ) {
     317    global $bp;
     318
     319    $defaults = array(
     320        'type' => 'active', // active, alphabetical, newest, or random.
     321        'user_id' => false, // Pass a user_id to limit to only blogs that this user has privilages higher than subscriber on.
     322        'search_terms' => false, // Limit to blogs that match these search terms
     323
     324        'per_page' => 20, // The number of results to return per page
     325        'page' => 1, // The page to return if limiting per page
     326    );
     327
     328    $params = wp_parse_args( $args, $defaults );
     329    extract( $params, EXTR_SKIP );
     330
     331    return apply_filters( 'bp_blogs_get_blogs', BP_Blogs_Blog::get( $type, $per_page, $page, $user_id, $search_terms ), &$params );
     332}
     333
    315334
    316335function bp_blogs_record_existing_blogs() {
Note: See TracChangeset for help on using the changeset viewer.