Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/12/2021 08:43:39 PM (3 years ago)
Author:
espellcaste
Message:

Update all references from wp_parse_args to bp_parse_args.

Also, add WPCS improvements to align bp_parse_args correctly.

Props imath
Fixes #8564

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r12779 r13108  
    4545
    4646    // Parse query arguments.
    47     $r = bp_parse_args( $args, array(
    48         'type'              => 'active', // 'active', 'alphabetical', 'newest', or 'random'.
    49         'include_blog_ids'  => false,    // Array of blog IDs to include.
    50         'user_id'           => false,    // Limit to blogs this user can post to.
    51         'search_terms'      => false,    // Limit to blogs matching these search terms.
    52         'per_page'          => 20,       // The number of results to return per page.
    53         'page'              => 1,        // The page to return if limiting per page.
    54         'update_meta_cache' => true      // Whether to pre-fetch blogmeta.
    55     ), 'blogs_get_blogs' );
     47    $r = bp_parse_args(
     48        $args,
     49        array(
     50            'type'              => 'active', // 'active', 'alphabetical', 'newest', or 'random'.
     51            'include_blog_ids'  => false,    // Array of blog IDs to include.
     52            'user_id'           => false,    // Limit to blogs this user can post to.
     53            'search_terms'      => false,    // Limit to blogs matching these search terms.
     54            'per_page'          => 20,       // The number of results to return per page.
     55            'page'              => 1,        // The page to return if limiting per page.
     56            'update_meta_cache' => true,     // Whether to pre-fetch blogmeta.
     57        ),
     58        'blogs_get_blogs'
     59    );
    5660
    5761    // Get the blogs.
     
    100104
    101105    // Query for all sites in network.
    102     $r = bp_parse_args( $args, array(
    103         'offset'   => (int) bp_get_option( '_bp_record_blogs_offset' ),
    104         'limit'    => 50,
    105         'blog_ids' => array(),
    106         'site_id'  => $wpdb->siteid
    107     ), 'record_existing_blogs' );
     106    $r = bp_parse_args(
     107        $args,
     108        array(
     109            'offset'   => (int) bp_get_option( '_bp_record_blogs_offset' ),
     110            'limit'    => 50,
     111            'blog_ids' => array(),
     112            'site_id'  => $wpdb->siteid,
     113        ),
     114        'record_existing_blogs'
     115    );
    108116
    109117    // Truncate all BP blogs tables if starting fresh.
     
    15321540    );
    15331541
    1534     $submitted_vars = wp_parse_args( $_POST, $exprected_vars );
     1542    $submitted_vars = bp_parse_args(
     1543        $_POST,
     1544        $exprected_vars
     1545    );
    15351546
    15361547    return array_map( 'wp_unslash', array_intersect_key( $submitted_vars, $exprected_vars ) );
Note: See TracChangeset for help on using the changeset viewer.