Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/12/2021 08:43:39 PM (2 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-attachment.php

    r12588 r13108  
    8282        $this->default_args['original_max_filesize'] = (int) wp_max_upload_size();
    8383
    84         $params = bp_parse_args( $args, $this->default_args, $this->action . '_upload_params' );
     84        $params = bp_parse_args(
     85            $args,
     86            $this->default_args,
     87            $this->action . '_upload_params'
     88        );
    8589
    8690        foreach ( $params as $key => $param ) {
     
    444448        $wp_error = new WP_Error();
    445449
    446         $r = bp_parse_args( $args, array(
    447             'original_file' => '',
    448             'crop_x'        => 0,
    449             'crop_y'        => 0,
    450             'crop_w'        => 0,
    451             'crop_h'        => 0,
    452             'dst_w'         => 0,
    453             'dst_h'         => 0,
    454             'src_abs'       => false,
    455             'dst_file'      => false,
    456         ), 'bp_attachment_crop_args' );
     450        $r = bp_parse_args(
     451            $args,
     452            array(
     453                'original_file' => '',
     454                'crop_x'        => 0,
     455                'crop_y'        => 0,
     456                'crop_w'        => 0,
     457                'crop_h'        => 0,
     458                'dst_w'         => 0,
     459                'dst_h'         => 0,
     460                'src_abs'       => false,
     461                'dst_file'      => false,
     462            ),
     463            'bp_attachment_crop_args'
     464        );
    457465
    458466        if ( empty( $r['original_file'] ) || ! file_exists( $r['original_file'] ) ) {
     
    623631        }
    624632
    625         $r = bp_parse_args( $args, array(
    626             'file'   => '',
    627             'max_w'   => 0,
    628             'max_h'   => 0,
    629             'crop'    => false,
    630             'rotate'  => 0,
    631             'quality' => 90,
    632             'save'    => true,
    633         ), 'attachment_' . $attachment_type . '_edit_image' );
     633        $r = bp_parse_args(
     634            $args,
     635            array(
     636                'file'    => '',
     637                'max_w'   => 0,
     638                'max_h'   => 0,
     639                'crop'    => false,
     640                'rotate'  => 0,
     641                'quality' => 90,
     642                'save'    => true,
     643            ),
     644            'attachment_' . $attachment_type . '_edit_image'
     645        );
    634646
    635647        // Make sure we have to edit the image.
Note: See TracChangeset for help on using the changeset viewer.