Skip to:
Content

BuddyPress.org

Changeset 12867


Ignore:
Timestamp:
03/17/2021 08:36:06 PM (9 months ago)
Author:
dcavins
Message:

BP_Invitation: Ensure that default args are set in get_total_count().

In BP_Invitation::get_total_count(), use bp_parse_args() to ensure that good defaults are set before the arguments are sent to get_where_sql().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-invitation.php

    r12866 r12867  
    831831        $invites_table_name = BP_Invitation_Manager::get_table_name();
    832832
     833        $r  = bp_parse_args( $args, array(
     834            'id'                => false,
     835            'user_id'           => false,
     836            'inviter_id'        => false,
     837            'invitee_email'     => false,
     838            'class'             => false,
     839            'item_id'           => false,
     840            'secondary_item_id' => false,
     841            'type'              => 'all',
     842            'invite_sent'       => 'all',
     843            'accepted'          => 'pending',
     844            'search_terms'      => '',
     845            'order_by'          => false,
     846            'sort_order'        => false,
     847            'page'              => false,
     848            'per_page'          => false,
     849            'fields'            => 'all',
     850        ), 'bp_invitations_invitation_get_total_count' );
     851
    833852        // Build the query
    834853        $select_sql = "SELECT COUNT(*)";
    835854        $from_sql   = "FROM {$invites_table_name}";
    836         $where_sql  = self::get_where_sql( $args );
     855        $where_sql  = self::get_where_sql( $r );
    837856        $sql        = "{$select_sql} {$from_sql} {$where_sql}";
    838857
Note: See TracChangeset for help on using the changeset viewer.