Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/12/2021 08:43:39 PM (5 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-core/classes/class-bp-invitation-manager.php

    r12916 r13108  
    8282        public function add_invitation( $args = array() ) {
    8383
    84                 $r = bp_parse_args( $args, array(
    85                         'user_id'           => 0,
    86                         'invitee_email'     => '',
    87                         'inviter_id'        => 0,
    88                         'item_id'           => 0,
    89                         'secondary_item_id' => 0,
    90                         'type'              => 'invite',
    91                         'content'           => '',
    92                         'date_modified'     => bp_core_current_time(),
    93                         'send_invite'       => 0,
    94                         'accepted'          => 0
    95                 ), 'add_invitation' );
     84                $r = bp_parse_args(
     85                        $args,
     86                        array(
     87                                'user_id'           => 0,
     88                                'invitee_email'     => '',
     89                                'inviter_id'        => 0,
     90                                'item_id'           => 0,
     91                                'secondary_item_id' => 0,
     92                                'type'              => 'invite',
     93                                'content'           => '',
     94                                'date_modified'     => bp_core_current_time(),
     95                                'send_invite'       => 0,
     96                                'accepted'          => 0,
     97                        ),
     98                        'add_invitation'
     99                );
    96100
    97101                // Invitations must have an invitee and inviter.
     
    236240        public function add_request( $args = array() ) {
    237241
    238                 $r = bp_parse_args( $args, array(
    239                         'user_id'           => 0,
    240                         'inviter_id'        => 0,
    241                         'invitee_email'     => '',
    242                         'item_id'           => 0,
    243                         'secondary_item_id' => 0,
    244                         'type'              => 'request',
    245                         'content'           => '',
    246                         'date_modified'     => bp_core_current_time(),
    247                         'invite_sent'       => 0,
    248                         'accepted'          => 0
    249                 ), 'add_request' );
     242                $r = bp_parse_args(
     243                        $args,
     244                        array(
     245                                'user_id'           => 0,
     246                                'inviter_id'        => 0,
     247                                'invitee_email'     => '',
     248                                'item_id'           => 0,
     249                                'secondary_item_id' => 0,
     250                                'type'              => 'request',
     251                                'content'           => '',
     252                                'date_modified'     => bp_core_current_time(),
     253                                'invite_sent'       => 0,
     254                                'accepted'          => 0,
     255                        ),
     256                        'add_request'
     257                );
    250258
    251259                // If there is no invitee, bail.
     
    502510         * @return int|bool Number of rows updated on success, false on failure.
    503511         */
    504          public function accept_invitation( $args = array() ) {
    505 
    506                 $r = bp_parse_args( $args, array(
    507                         'id'                => false,
    508                         'user_id'           => 0,
    509                         'invitee_email'     => '',
    510                         'item_id'           => null,
    511                         'secondary_item_id' => null,
    512                         'invite_sent'       => 'sent',
    513                         'date_modified'     => bp_core_current_time(),
    514                 ), 'accept_invitation' );
     512        public function accept_invitation( $args = array() ) {
     513
     514                $r = bp_parse_args(
     515                        $args,
     516                        array(
     517                                'id'                => false,
     518                                'user_id'           => 0,
     519                                'invitee_email'     => '',
     520                                'item_id'           => null,
     521                                'secondary_item_id' => null,
     522                                'invite_sent'       => 'sent',
     523                                'date_modified'     => bp_core_current_time(),
     524                        ),
     525                        'accept_invitation'
     526                );
     527
    515528                $r['class'] = $this->class_name;
    516529
     
    555568         * @return bool Number of rows updated on success, false on failure.
    556569         */
    557          public function accept_request( $args = array() ) {
    558 
    559                 $r = bp_parse_args( $args, array(
    560                         'user_id'           => 0,
    561                         'item_id'           => null,
    562                         'secondary_item_id' => null,
    563                         'date_modified'     => bp_core_current_time(),
    564                 ), 'accept_request' );
     570        public function accept_request( $args = array() ) {
     571
     572                $r = bp_parse_args(
     573                        $args,
     574                        array(
     575                                'user_id'           => 0,
     576                                'item_id'           => null,
     577                                'secondary_item_id' => null,
     578                                'date_modified'     => bp_core_current_time(),
     579                        ),
     580                        'accept_request'
     581                );
     582
    565583                $r['class'] = $this->class_name;
    566584
Note: See TracChangeset for help on using the changeset viewer.