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-messages/bp-messages-template.php

    r13102 r13108  
    6565
    6666    // Parse the arguments.
    67     $r = bp_parse_args( $args, array(
    68         'user_id'      => $user_id,
    69         'box'          => $default_box,
    70         'per_page'     => 10,
    71         'max'          => false,
    72         'type'         => 'all',
    73         'search_terms' => $search_terms,
    74         'page_arg'     => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679.
    75         'meta_query'   => array()
    76     ), 'has_message_threads' );
     67    $r = bp_parse_args(
     68        $args,
     69        array(
     70            'user_id'      => $user_id,
     71            'box'          => $default_box,
     72            'per_page'     => 10,
     73            'max'          => false,
     74            'type'         => 'all',
     75            'search_terms' => $search_terms,
     76            'page_arg'     => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679.
     77            'meta_query'   => array(),
     78        ),
     79        'has_message_threads'
     80    );
    7781
    7882    // Load the messages loop global up with messages.
     
    755759        $alt      = sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname );
    756760
    757         $r = bp_parse_args( $args, array(
    758             'type'   => 'thumb',
    759             'width'  => false,
    760             'height' => false,
    761             'class'  => 'avatar',
    762             'id'     => false,
    763             'alt'    => $alt
    764         ) );
     761        $r = bp_parse_args(
     762            $args,
     763            array(
     764                'type'   => 'thumb',
     765                'width'  => false,
     766                'height' => false,
     767                'class'  => 'avatar',
     768                'id'     => false,
     769                'alt'    => $alt,
     770            )
     771        );
    765772
    766773        /**
     
    15161523    function bp_get_send_message_button( $args = '' ) {
    15171524
    1518         $r = bp_parse_args( $args, array(
    1519             'id'                => 'private_message',
    1520             'component'         => 'messages',
    1521             'must_be_logged_in' => true,
    1522             'block_self'        => true,
    1523             'wrapper_id'        => 'send-private-message',
    1524             'link_href'         => bp_get_send_private_message_link(),
    1525             'link_text'         => __( 'Private Message', 'buddypress' ),
    1526             'link_class'        => 'send-message',
    1527         ) );
    1528 
     1525        $r = bp_parse_args(
     1526            $args,
     1527            array(
     1528                'id'                => 'private_message',
     1529                'component'         => 'messages',
     1530                'must_be_logged_in' => true,
     1531                'block_self'        => true,
     1532                'wrapper_id'        => 'send-private-message',
     1533                'link_href'         => bp_get_send_private_message_link(),
     1534                'link_text'         => __( 'Private Message', 'buddypress' ),
     1535                'link_class'        => 'send-message',
     1536            )
     1537        );
    15291538
    15301539        // Note: 'bp_get_send_message_button' is a legacy filter. Use
     
    20492058        global $thread_template;
    20502059
    2051         $r = bp_parse_args( $args, array(
    2052             'type'   => 'thumb',
    2053             'width'  => false,
    2054             'height' => false,
    2055         ) );
     2060        $r = bp_parse_args(
     2061            $args,
     2062            array(
     2063                'type'   => 'thumb',
     2064                'width'  => false,
     2065                'height' => false,
     2066            )
     2067        );
    20562068
    20572069        /**
Note: See TracChangeset for help on using the changeset viewer.