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-activity/classes/class-bp-activity-activity.php

    r13086 r13108  
    414414
    415415        $bp = buddypress();
    416         $r  = wp_parse_args( $args, array(
    417             'page'              => 1,               // The current page.
    418             'per_page'          => 25,              // Activity items per page.
    419             'max'               => false,           // Max number of items to return.
    420             'fields'            => 'all',           // Fields to include.
    421             'sort'              => 'DESC',          // ASC or DESC.
    422             'order_by'          => 'date_recorded', // Column to order by.
    423             'exclude'           => false,           // Array of ids to exclude.
    424             'in'                => false,           // Array of ids to limit query by (IN).
    425             'meta_query'        => false,           // Filter by activitymeta.
    426             'date_query'        => false,           // Filter by date.
    427             'filter_query'      => false,           // Advanced filtering - see BP_Activity_Query.
    428             'filter'            => false,           // See self::get_filter_sql().
    429             'scope'             => false,           // Preset activity arguments.
    430             'search_terms'      => false,           // Terms to search by.
    431             'display_comments'  => false,           // Whether to include activity comments.
    432             'show_hidden'       => false,           // Show items marked hide_sitewide.
    433             'spam'              => 'ham_only',      // Spam status.
    434             'update_meta_cache' => true,            // Whether or not to update meta cache.
    435             'count_total'       => false,           // Whether or not to use count_total.
    436         ) );
     416        $r  = bp_parse_args(
     417            $args,
     418            array(
     419                'page'              => 1,               // The current page.
     420                'per_page'          => 25,              // Activity items per page.
     421                'max'               => false,           // Max number of items to return.
     422                'fields'            => 'all',           // Fields to include.
     423                'sort'              => 'DESC',          // ASC or DESC.
     424                'order_by'          => 'date_recorded', // Column to order by.
     425                'exclude'           => false,           // Array of ids to exclude.
     426                'in'                => false,           // Array of ids to limit query by (IN).
     427                'meta_query'        => false,           // Filter by activitymeta.
     428                'date_query'        => false,           // Filter by date.
     429                'filter_query'      => false,           // Advanced filtering - see BP_Activity_Query.
     430                'filter'            => false,           // See self::get_filter_sql().
     431                'scope'             => false,           // Preset activity arguments.
     432                'search_terms'      => false,           // Terms to search by.
     433                'display_comments'  => false,           // Whether to include activity comments.
     434                'show_hidden'       => false,           // Show items marked hide_sitewide.
     435                'spam'              => 'ham_only',      // Spam status.
     436                'update_meta_cache' => true,            // Whether or not to update meta cache.
     437                'count_total'       => false,           // Whether or not to use count_total.
     438            )
     439        );
    437440
    438441        // Select conditions.
     
    12581261
    12591262        $bp = buddypress();
    1260         $r  = wp_parse_args( $args, array(
    1261             'id'                => false,
    1262             'action'            => false,
    1263             'content'           => false,
    1264             'component'         => false,
    1265             'type'              => false,
    1266             'primary_link'      => false,
    1267             'user_id'           => false,
    1268             'item_id'           => false,
    1269             'secondary_item_id' => false,
    1270             'date_recorded'     => false,
    1271             'hide_sitewide'     => false
    1272         ) );
     1263        $r  = bp_parse_args(
     1264            $args,
     1265            array(
     1266                'id'                => false,
     1267                'action'            => false,
     1268                'content'           => false,
     1269                'component'         => false,
     1270                'type'              => false,
     1271                'primary_link'      => false,
     1272                'user_id'           => false,
     1273                'item_id'           => false,
     1274                'secondary_item_id' => false,
     1275                'date_recorded'     => false,
     1276                'hide_sitewide'     => false,
     1277            )
     1278        );
    12731279
    12741280        // Setup empty array from where query arguments.
Note: See TracChangeset for help on using the changeset viewer.