Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/12/2021 08:43:39 PM (4 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/bp-core-buddybar.php

    r13093 r13108  
    5151        'position'                => 99,    // Index of where this nav item should be positioned.
    5252        'screen_function'         => false, // The name of the function to run when clicked.
    53         'default_subnav_slug'     => false  // The slug of the default subnav item to select when clicked.
    54     );
    55 
    56     $r = wp_parse_args( $args, $defaults );
     53        'default_subnav_slug'     => false, // The slug of the default subnav item to select when clicked.
     54    );
     55
     56    $r = bp_parse_args(
     57        $args,
     58        $defaults
     59    );
    5760
    5861    // Validate nav link data.
     
    131134    );
    132135
    133     $r = wp_parse_args( $args, $defaults );
     136    $r = bp_parse_args(
     137        $args,
     138        $defaults
     139    );
    134140
    135141    // If we don't have the required info we need, don't create this nav item.
     
    218224    );
    219225
    220     $r = wp_parse_args( $args, $defaults );
     226    $r = bp_parse_args(
     227        $args,
     228        $defaults
     229    );
    221230
    222231    // If we don't have the required info we need, don't register this screen function.
     
    315324    );
    316325
    317     $r = wp_parse_args( $args, $defaults );
     326    $r = bp_parse_args(
     327        $args,
     328        $defaults
     329    );
    318330
    319331    // This is specific to Members - it's not available in Groups.
     
    530542    $bp = buddypress();
    531543
    532     $r = wp_parse_args( $args, array(
    533         'name'              => false, // Display name for the nav item.
    534         'slug'              => false, // URL slug for the nav item.
    535         'parent_slug'       => false, // URL slug of the parent nav item.
    536         'parent_url'        => false, // URL of the parent item.
    537         'item_css_id'       => false, // The CSS ID to apply to the HTML of the nav item.
    538         'user_has_access'   => true,  // Can the logged in user see this nav item?
    539         'no_access_url'     => '',
    540         'site_admin_only'   => false, // Can only site admins see this nav item?
    541         'position'          => 90,    // Index of where this nav item should be positioned.
    542         'screen_function'   => false, // The name of the function to run when clicked.
    543         'link'              => '',    // The link for the subnav item; optional, not usually required.
    544         'show_in_admin_bar' => false, // Show the Manage link in the current group's "Edit" Admin Bar menu.
    545     ) );
     544    $r = bp_parse_args(
     545        $args,
     546        array(
     547            'name'              => false, // Display name for the nav item.
     548            'slug'              => false, // URL slug for the nav item.
     549            'parent_slug'       => false, // URL slug of the parent nav item.
     550            'parent_url'        => false, // URL of the parent item.
     551            'item_css_id'       => false, // The CSS ID to apply to the HTML of the nav item.
     552            'user_has_access'   => true,  // Can the logged in user see this nav item?
     553            'no_access_url'     => '',
     554            'site_admin_only'   => false, // Can only site admins see this nav item?
     555            'position'          => 90,    // Index of where this nav item should be positioned.
     556            'screen_function'   => false, // The name of the function to run when clicked.
     557            'link'              => '',    // The link for the subnav item; optional, not usually required.
     558            'show_in_admin_bar' => false, // Show the Manage link in the current group's "Edit" Admin Bar menu.
     559        )
     560    );
    546561
    547562    // If we don't have the required info we need, don't create this subnav item.
     
    626641    $bp = buddypress();
    627642
    628     $r = wp_parse_args( $args, array(
    629         'slug'              => false, // URL slug for the screen.
    630         'parent_slug'       => false, // URL slug of the parent screen.
    631         'user_has_access'   => true,  // Can the user visit this screen?
    632         'no_access_url'     => '',
    633         'site_admin_only'   => false, // Can only site admins visit this screen?
    634         'screen_function'   => false, // The name of the function to run when clicked.
    635     ) );
     643    $r = bp_parse_args(
     644        $args,
     645        array(
     646            'slug'              => false, // URL slug for the screen.
     647            'parent_slug'       => false, // URL slug of the parent screen.
     648            'user_has_access'   => true,  // Can the user visit this screen?
     649            'no_access_url'     => '',
     650            'site_admin_only'   => false, // Can only site admins visit this screen?
     651            'screen_function'   => false, // The name of the function to run when clicked.
     652        )
     653    );
    636654
    637655    /*
Note: See TracChangeset for help on using the changeset viewer.