Skip to:
Content

bbPress.org

Changeset 3280


Ignore:
Timestamp:
05/31/2011 01:46:26 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Add values to global bbPress object vars. Adjust bbp_is_user_home() function to work with empty() rather than isset()

Location:
branches/plugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-general-template.php

    r3279 r3280  
    338338        global $bbp;
    339339
    340         if ( !isset( $bbp->displayed_user ) )
     340        if ( empty( $bbp->displayed_user ) )
    341341                return false;
    342342
  • branches/plugin/bbpress.php

    r3278 r3280  
    4949         * @var string Forum post type id
    5050         */
    51         var $forum_post_type;
     51        var $forum_post_type = '';
    5252
    5353        /**
    5454         * @var string Topic post type id
    5555         */
    56         var $topic_post_type;
     56        var $topic_post_type = '';
    5757
    5858        /**
    5959         * @var string Reply post type id
    6060         */
    61         var $reply_post_type;
     61        var $reply_post_type = '';
    6262
    6363        /** Taxonomies ************************************************************/
    … …  
    6666         * @var string Topic tag id
    6767         */
    68         var $topic_tag_id;
    69 
     68        var $topic_tag_id = '';
     69
     70        /** Permastructs **********************************************************/
     71       
     72        /**
     73         * @var string User struct
     74         */
     75        var $user_id = '';
     76       
     77        /**
     78         * @var string View struct
     79         */
     80        var $view_id = '';
     81       
     82        /**
     83         * @var string Edit struct
     84         */
     85        var $edit_id = '';
     86       
    7087        /** Post statuses *********************************************************/
    7188
    … …  
    7390         * @var string Closed post status id. Used by topics.
    7491         */
    75         var $closed_status_id;
     92        var $closed_status_id = '';
    7693
    7794        /**
    7895         * @var string Spam post status id. Used by topics and replies.
    7996         */
    80         var $spam_status_id;
     97        var $spam_status_id = '';
    8198
    8299        /**
    83100         * @var string Trash post status id. Used by topics and replies.
    84101         */
    85         var $trash_status_id;
     102        var $trash_status_id = '';
    86103
    87104        /**
    88105         * @var string Orphan post status id. Used by topics and replies.
    89106         */
    90         var $orphan_status_id;
     107        var $orphan_status_id = '';
    91108
    92109        /**
    93110         * @var string Hidden post status id. Used by forums.
    94111         */
    95         var $hidden_status_id;
     112        var $hidden_status_id = '';
    96113
    97114        /** Slugs *****************************************************************/
    … …  
    100117         * @var string Root slug
    101118         */
    102         var $root_slug;
     119        var $root_slug = '';
    103120
    104121        /**
    105122         * @var string Forum slug
    106123         */
    107         var $forum_slug;
     124        var $forum_slug = '';
    108125
    109126        /**
    110127         * @var string Topic slug
    111128         */
    112         var $topic_slug;
     129        var $topic_slug = '';
    113130
    114131        /**
    115132         * @var string Topic archive slug
    116133         */
    117         var $topic_archive_slug;
     134        var $topic_archive_slug = '';
    118135
    119136        /**
    120137         * @var string Reply slug
    121138         */
    122         var $reply_slug;
     139        var $reply_slug = '';
    123140
    124141        /**
    125142         * @var string Topic tag slug
    126143         */
    127         var $topic_tag_slug;
     144        var $topic_tag_slug = '';
    128145
    129146        /**
    130147         * @var string User slug
    131148         */
    132         var $user_slug;
     149        var $user_slug = '';
    133150
    134151        /**
    135152         * @var string View slug
    136153         */
    137         var $view_slug;
     154        var $view_slug = '';
    138155
    139156        /** Paths *****************************************************************/
    … …  
    142159         * @var string Absolute path to the bbPress plugin directory
    143160         */
    144         var $plugin_dir;
     161        var $plugin_dir = '';
    145162
    146163        /**
    147164         * @var string Absolute path to the bbPress themes directory
    148165         */
    149         var $themes_dir;
     166        var $themes_dir = '';
    150167
    151168        /**
    152169         * @var string Absolute path to the bbPress language directory
    153170         */
    154         var $lang_dir;
     171        var $lang_dir = '';
    155172
    156173        /** URLs ******************************************************************/
    … …  
    159176         * @var string URL to the bbPress plugin directory
    160177         */
    161         var $plugin_url;
     178        var $plugin_url = '';
    162179
    163180        /**
    164181         * @var string URL to the bbPress themes directory
    165182         */
    166         var $themes_url;
     183        var $themes_url = '';
    167184
    168185        /** Current ID's **********************************************************/
    … …  
    188205         * @var object Current user
    189206         */
    190         var $current_user;
     207        var $current_user = array();
    191208
    192209        /**
    193210         * @var object Displayed user
    194211         */
    195         var $displayed_user;
     212        var $displayed_user = array();
    196213
    197214        /** Queries ***************************************************************/
    … …  
    200217         * @var WP_Query For forums
    201218         */
    202         var $forum_query;
     219        var $forum_query = array();
    203220
    204221        /**
    205222         * @var WP_Query For topics
    206223         */
    207         var $topic_query;
     224        var $topic_query = array();
    208225
    209226        /**
    210227         * @var WP_Query For replies
    211228         */
    212         var $reply_query;
     229        var $reply_query = array();
    213230
    214231        /** Arrays ****************************************************************/
    … …  
    217234         * @var array Sub Forums
    218235         */
    219         var $sub_forums;
     236        var $sub_forums = array();
    220237
    221238        /** Errors ****************************************************************/
    … …  
    224241         * @var WP_Error Used to log and display errors
    225242         */
    226         var $errors;
     243        var $errors = array();
    227244
    228245        /** Views *****************************************************************/
    … …  
    231248         * @var array An array of registered bbPress views
    232249         */
    233         var $views;
     250        var $views = array();
    234251
    235252        /** Forms *****************************************************************/
    … …  
    238255         * @var int The current tab index for form building
    239256         */
    240         var $tab_index;
     257        var $tab_index = 0;
    241258
    242259        /** Theme Compat **********************************************************/
    … …  
    853870         * @since bbPress (r2697)
    854871         *
    855          * @uses get_currentuserinfo()
    856          * @global WP_User Current user object
     872         * @uses wp_get_current_user()
    857873         */
    858874        function setup_current_user() {
    859                 global $current_user;
    860 
    861                 if ( !isset( $current_user ) )
    862                         $current_user = get_currentuserinfo();
    863 
    864                 // Set the current user in the bbPress global
    865                 $this->current_user = $current_user;
     875                $this->current_user = wp_get_current_user();
    866876        }
    867877
Note: See TracChangeset for help on using the changeset viewer.