Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/09/2016 01:58:10 PM (9 years ago)
Author:
xknown
Message:

Add PHP 5.x style constructors.

Keep also the PHP 4.x style constructors to avoid breaking code that depends on these methods.

See #3033

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bb-includes/class.bb-query.php

    r3371 r6153  
    1717
    1818    // Can optionally pass unique id string to help out filters
    19     function BB_Query( $type = 'topic', $query = '', $id = '' ) {
     19    function __construct( $type = 'topic', $query = '', $id = '' ) {
    2020        $this->init( $type, $query, $id );
    2121
    2222        if ( !empty($this->query) )
    2323            $this->query();
     24    }
     25
     26    function BB_Query( $type = 'topic', $query = '', $id = '' ) {
     27        $this->__construct( $type, $query, $id );
    2428    }
    2529
     
    883887
    884888    // Can optionally pass unique id string to help out filters
    885     function BB_Query_Form( $type = 'topic', $defaults = '', $allowed = '', $id = '' ) {
     889    function __construct( $type = 'topic', $defaults = '', $allowed = '', $id = '' ) {
    886890        $this->defaults = wp_parse_args( $defaults );
    887891        $this->allowed  = wp_parse_args( $allowed );
    888892        if ( !empty($defaults) || !empty($allowed) )
    889893            $this->query_from_env($type, $defaults, $allowed, $id);
     894    }
     895
     896    function BB_Query_Form( $type = 'topic', $defaults = '', $allowed = '', $id = '' ) {
     897        $this->__construct( $type, $defaults, $allowed, $id );
    890898    }
    891899
Note: See TracChangeset for help on using the changeset viewer.