Skip to:
Content

BuddyPress.org

Changeset 12107


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.

Location:
trunk/src/bp-templates/bp-nouveau
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress-functions.php

    r12082 r12107  
    267267                }
    268268
    269                 $data = wp_parse_args( $style, array(
    270                     'dependencies' => array(),
    271                     'version'      => $this->version,
    272                     'type'         => 'screen',
    273                 ) );
     269                $data = bp_parse_args(
     270                    $style,
     271                    array(
     272                        'dependencies' => array(),
     273                        'version'      => $this->version,
     274                        'type'         => 'screen',
     275                    ),
     276                    'nouveau_enqueue_styles'
     277                );
    274278
    275279                wp_enqueue_style( $handle, $file, $data['dependencies'], $data['version'], $data['type'] );
     
    346350            }
    347351
    348             $data = wp_parse_args( $script, array(
    349                 'dependencies' => array(),
    350                 'version'      => $this->version,
    351                 'footer'       => false,
    352             ) );
     352            $data = bp_parse_args(
     353                $script,
     354                array(
     355                    'dependencies' => array(),
     356                    'version'      => $this->version,
     357                    'footer'       => false,
     358                ),
     359                'nouveau_register_scripts'
     360            );
    353361
    354362            wp_register_script( $handle, $file, $data['dependencies'], $data['version'], $data['footer'] );
     
    628636            return $path;
    629637        } else {
    630             $vars = wp_parse_args( $uri['query'], array() );
     638            $vars = bp_parse_args(
     639                $uri['query'],
     640                array(),
     641                'customizer_set_uri'
     642            );
    631643
    632644            if ( ! empty( $vars['url'] ) ) {
  • trunk/src/bp-templates/bp-nouveau/includes/activity/template-tags.php

    r12106 r12107  
    436436            }
    437437
    438             $delete_args = wp_parse_args( $delete_args, array(
    439                 'link_text'   => '',
    440                 'button_attr' => array(
    441                     'link_id'         => '',
    442                     'link_href'       => '',
    443                     'link_class'      => '',
    444                     'link_rel'        => 'nofollow',
    445                     'data_bp_tooltip' => '',
     438            $delete_args = bp_parse_args(
     439                $delete_args,
     440                array(
     441                    'link_text'   => '',
     442                    'button_attr' => array(
     443                        'link_id'         => '',
     444                        'link_href'       => '',
     445                        'link_class'      => '',
     446                        'link_rel'        => 'nofollow',
     447                        'data_bp_tooltip' => '',
     448                    ),
    446449                ),
    447             ) );
     450                'nouveau_get_activity_entry_buttons'
     451            );
    448452        }
    449453
  • trunk/src/bp-templates/bp-nouveau/includes/activity/widgets.php

    r12106 r12107  
    166166     */
    167167    public function form( $instance ) {
    168         $instance = wp_parse_args( (array) $instance, array(
    169             'title' => __( 'Latest updates', 'buddypress' ),
    170             'max'   => 5,
    171             'type'  => '',
    172         ) );
     168        $instance = bp_parse_args(
     169            (array) $instance,
     170            array(
     171                'title' => __( 'Latest updates', 'buddypress' ),
     172                'max'   => 5,
     173                'type'  => '',
     174            ),
     175            'widget_latest_activities'
     176        );
    173177
    174178        $title = esc_attr( $instance['title'] );
  • 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'];
  • trunk/src/bp-templates/bp-nouveau/includes/functions.php

    r12104 r12107  
    4545
    4646    if ( ! empty( $_POST ) ) {
    47         $post_query = wp_parse_args( $_POST, $post_query );
     47        $post_query = bp_parse_args(
     48            $_POST,
     49            $post_query,
     50            'nouveau_ajax_querystring'
     51        );
    4852
    4953        // Make sure to transport the scope, filter etc.. in HeartBeat Requests
     
    5357            // Remove heartbeat specific vars
    5458            $post_query = array_diff_key(
    55                 wp_parse_args( $bp_heartbeat, $post_query ),
     59                bp_parse_args(
     60                    $bp_heartbeat,
     61                    $post_query,
     62                    'nouveau_ajax_querystring_heartbeat'
     63                ),
    5664                array(
    5765                    'data'      => false,
     
    243251    }
    244252
    245     $r = wp_parse_args( $args, array(
    246         'container'         => 'div',
    247         'container_id'      => '',
    248         'container_classes' => array( $generic_class, $current_component_class   ),
    249         'output'            => '',
    250     ) );
     253    $r = bp_parse_args(
     254        $args,
     255        array(
     256            'container'         => 'div',
     257            'container_id'      => '',
     258            'container_classes' => array( $generic_class, $current_component_class   ),
     259            'output'            => '',
     260        ),
     261        'nouveau_wrapper'
     262    );
    251263
    252264    $valid_containers = array(
  • trunk/src/bp-templates/bp-nouveau/includes/groups/ajax.php

    r12104 r12107  
    278278    }
    279279
    280     $request = wp_parse_args( $_POST, array(
    281         'scope' => 'members',
    282     ) );
     280    $request = bp_parse_args(
     281        $_POST,
     282        array(
     283            'scope' => 'members',
     284        ),
     285        'nouveau_ajax_get_users_to_invite'
     286    );
    283287
    284288    $bp->groups->invites_scope = 'members';
  • trunk/src/bp-templates/bp-nouveau/includes/groups/classes.php

    r12082 r12107  
    4040     */
    4141    public function build_exclude_args() {
    42         $this->query_vars = wp_parse_args( $this->query_vars, array(
    43             'group_id'     => 0,
    44             'is_confirmed' => true,
    45         ) );
     42        $this->query_vars = bp_parse_args(
     43            $this->query_vars,
     44            array(
     45                'group_id'     => 0,
     46                'is_confirmed' => true,
     47            ),
     48            'nouveau_group_invite_query_exlude_args'
     49        );
    4650
    4751        $group_member_ids = $this->get_group_member_ids();
  • trunk/src/bp-templates/bp-nouveau/includes/notifications/functions.php

    r12104 r12107  
    8585    $bp_nouveau = bp_nouveau();
    8686
    87     $r = wp_parse_args( $args, array(
    88         'id'       => '',
    89         'label'    => '',
    90         'position' => 99,
    91     ) );
     87    $r = bp_parse_args(
     88        $args,
     89        array(
     90            'id'       => '',
     91            'label'    => '',
     92            'position' => 99,
     93        ),
     94        'nouveau_notifications_register_filter'
     95    );
    9296
    9397    if ( empty( $r['id'] ) || empty( $r['label'] ) ) {
  • trunk/src/bp-templates/bp-nouveau/includes/template-tags.php

    r12104 r12107  
    709709    $bp_nouveau = bp_nouveau();
    710710
    711     $n = wp_parse_args( $args, array(
    712         'type'                    => 'primary',
    713         'object'                  => '',
    714         'user_has_access'         => true,
    715         'show_for_displayed_user' => true,
    716     ) );
     711    $n = bp_parse_args(
     712        $args,
     713        array(
     714            'type'                    => 'primary',
     715            'object'                  => '',
     716            'user_has_access'         => true,
     717            'show_for_displayed_user' => true,
     718        ),
     719        'nouveau_has_nav'
     720    );
    717721
    718722    if ( empty( $n['type'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.