Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/15/2015 02:33:11 AM (11 years ago)
Author:
johnjamesjacoby
Message:

All: Update default values for $args parameters from empty strings to empty arrays.

This is a micro-optimization to avoid unnecessary calls to wp_parse_str() inside bbp_parse_args().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/classes.php

    r5466 r5676  
    6161     * @since bbPress (r2700)
    6262     *
    63      * @param mixed $args Required. Supports these args:
     63     * @param array $args Required. Supports these args:
    6464     *  - name: Unique name (for internal identification)
    6565     *  - id: Unique ID (normally for custom post type)
     
    7171     * @uses BBP_Component::setup_actions() Setup the hooks and actions
    7272     */
    73     public function __construct( $args = '' ) {
     73    public function __construct( $args = array() ) {
    7474        if ( empty( $args ) ) {
    7575            return;
     
    9090     * @uses apply_filters() Calls 'bbp_{@link BBP_Component::name}_slug'
    9191     */
    92     private function setup_globals( $args = '' ) {
     92    private function setup_globals( $args = array() ) {
    9393        $this->name = $args['name'];
    9494        $this->id   = apply_filters( 'bbp_' . $this->name . '_id',   $args['id']   );
Note: See TracChangeset for help on using the changeset viewer.