Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/21/2018 01:14:05 AM (8 years ago)
Author:
djpaul
Message:

Templates, Nouveau: use bp_parse_args instead of wp_parse_args.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/classes.php

    r12104 r12107  
    4545        public function __construct( $args = array() ) {
    4646                foreach ( $args as $arg ) {
    47                         $r = wp_parse_args( (array) $arg, array(
    48                                 'id'                => '',
    49                                 'position'          => 99,
    50                                 'component'         => '',
    51                                 'must_be_logged_in' => true,
    52                                 'block_self'        => false,
    53                                 'parent_element'    => false,
    54                                 'parent_attr'       => array(),
    55                                 'button_element'    => 'a',
    56                                 'button_attr'       => array(),
    57                                 'link_text'         => '',
    58                         ) );
     47                        $r = bp_parse_args(
     48                                (array) $arg,
     49                                array(
     50                                        'id'                => '',
     51                                        'position'          => 99,
     52                                        'component'         => '',
     53                                        'must_be_logged_in' => true,
     54                                        'block_self'        => false,
     55                                        'parent_element'    => false,
     56                                        'parent_attr'       => array(),
     57                                        'button_element'    => 'a',
     58                                        'button_attr'       => array(),
     59                                        'link_text'         => '',
     60                                ),
     61                                'buttons_group_constructor'
     62                        );
    5963
    6064                        // Just don't set the button if a param is missing
     
    164168                foreach ( $args as $id => $params ) {
    165169                        if ( isset( $this->group[ $id ] ) ) {
    166                                 $this->group[ $id ] = wp_parse_args( $params, $this->group[ $id ] );
     170                                $this->group[ $id ] = bp_parse_args(
     171                                        $params,
     172                                        $this->group[ $id ],
     173                                        'buttons_group_update'
     174                                );
    167175                        }
    168176                }
     
    229237                 * }
    230238                 */
    231                 $item_nav_args = wp_parse_args( $instance, apply_filters( 'bp_nouveau_object_nav_widget_args', array(
    232                         'bp_nouveau_widget_title' => true,
    233                 ) ) );
     239                $item_nav_args = bp_parse_args(
     240                        $instance,
     241                        apply_filters(
     242                                'bp_nouveau_object_nav_widget_args',
     243                                array( 'bp_nouveau_widget_title' => true )
     244                        ),
     245                        'widget_object_nav'
     246                );
    234247
    235248                $title = '';
     
    304317                );
    305318
    306                 $instance = wp_parse_args( (array) $instance, $defaults );
     319                $instance = bp_parse_args(
     320                        (array) $instance,
     321                        $defaults,
     322                        'widget_object_nav_form'
     323                );
    307324
    308325                $bp_nouveau_widget_title = (bool) $instance['bp_nouveau_widget_title'];
Note: See TracChangeset for help on using the changeset viewer.