Skip to:
Content

bbPress.org

Changeset 4996


Ignore:
Timestamp:
06/23/2013 07:00:11 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Replace generic stdClass usages with correct object types.

Fixes debug notices with bbp_get_displayed_user_field() when requesting non-existing fields or when there is no displayed user, by allowing the magic get() methods of the WP_User class to bail if the field is not set.

Also prevents similar issues with main query loops. Fixes #2359.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bbpress.php

    r4993 r4996  
    247247        $this->current_topic_tag_id = 0; // Current topic tag id
    248248
    249         $this->forum_query    = new stdClass(); // Main forum query
    250         $this->topic_query    = new stdClass(); // Main topic query
    251         $this->reply_query    = new stdClass(); // Main reply query
    252         $this->search_query   = new stdClass(); // Main search query
     249        $this->forum_query    = new WP_Query(); // Main forum query
     250        $this->topic_query    = new WP_Query(); // Main topic query
     251        $this->reply_query    = new WP_Query(); // Main reply query
     252        $this->search_query   = new WP_Query(); // Main search query
    253253
    254254        /** Theme Compat ******************************************************/
     
    259259        /** Users *************************************************************/
    260260
    261         $this->current_user   = new stdClass(); // Currently logged in user
    262         $this->displayed_user = new stdClass(); // Currently displayed user
     261        $this->current_user   = new WP_User(); // Currently logged in user
     262        $this->displayed_user = new WP_User(); // Currently displayed user
    263263
    264264        /** Misc **************************************************************/
  • trunk/includes/common/shortcodes.php

    r4971 r4996  
    120120
    121121        // Unset global queries
    122         $bbp->forum_query  = new stdClass;
    123         $bbp->topic_query  = new stdClass;
    124         $bbp->reply_query  = new stdClass;
    125         $bbp->search_query = new stdClass;
     122        $bbp->forum_query  = new WP_Query();
     123        $bbp->topic_query  = new WP_Query();
     124        $bbp->reply_query  = new WP_Query();
     125        $bbp->search_query = new WP_Query();
    126126
    127127        // Unset global ID's
  • trunk/includes/users/functions.php

    r4995 r4996  
    869869
    870870        if ( $new_email['hash'] === $_GET['newuseremail'] ) {
    871             $user             = new stdClass();
     871            $user             = new WP_User();
    872872            $user->ID         = $user_id;
    873873            $user->user_email = esc_html( trim( $new_email['newemail'] ) );
Note: See TracChangeset for help on using the changeset viewer.