Changeset 2972
- Timestamp:
- 04/01/2011 03:00:10 AM (15 years ago)
- Location:
- branches/plugin
- Files:
-
- 4 edited
-
bbp-includes/bbp-forum-template.php (modified) (1 diff)
-
bbp-includes/bbp-reply-template.php (modified) (2 diffs)
-
bbp-includes/bbp-topic-template.php (modified) (3 diffs)
-
bbpress.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-forum-template.php
r2957 r2972 140 140 // Easy empty checking 141 141 if ( !empty( $forum_id ) && is_numeric( $forum_id ) ) 142 $bbp_forum_id = $ forum_id;142 $bbp_forum_id = $bbp->current_forum_id = $forum_id; 143 143 144 144 // Currently inside a forum loop 145 145 elseif ( !empty( $bbp->forum_query->in_the_loop ) && isset( $bbp->forum_query->post->ID ) ) 146 $bbp_forum_id = $bbp-> forum_query->post->ID;146 $bbp_forum_id = $bbp->current_forum_id = $bbp->forum_query->post->ID; 147 147 148 148 // Currently viewing a forum 149 149 elseif ( bbp_is_forum() && isset( $wp_query->post->ID ) ) 150 $bbp_forum_id = $ wp_query->post->ID;150 $bbp_forum_id = $bbp->current_forum_id = $wp_query->post->ID; 151 151 152 152 // Currently viewing a topic 153 153 elseif ( bbp_is_topic() ) 154 $bbp_forum_id = bbp_get_topic_forum_id();154 $bbp_forum_id = $bbp->current_forum_id = bbp_get_topic_forum_id(); 155 155 156 156 // Fallback 157 157 else 158 158 $bbp_forum_id = 0; 159 160 // Set global161 $bbp->current_forum_id = $bbp_forum_id;162 159 163 160 return apply_filters( 'bbp_get_forum_id', (int) $bbp_forum_id, $forum_id ); -
branches/plugin/bbp-includes/bbp-reply-template.php
r2962 r2972 221 221 // Currently viewing a reply 222 222 elseif ( ( bbp_is_reply() || bbp_is_reply_edit() ) && isset( $wp_query->post->ID ) ) 223 $bbp_reply_id = $ wp_query->post->ID;223 $bbp_reply_id = $bbp->current_reply_id = $wp_query->post->ID; 224 224 225 225 // Currently inside a replies loop 226 226 elseif ( isset( $bbp->reply_query->post->ID ) ) 227 $bbp_reply_id = $bbp-> reply_query->post->ID;227 $bbp_reply_id = $bbp->current_reply_id = $bbp->reply_query->post->ID; 228 228 229 229 // Fallback … … 231 231 $bbp_reply_id = 0; 232 232 233 $bbp->current_reply_id = $bbp_reply_id; 233 // Check if current_reply_id is set, and check post_type if so 234 if ( !empty( $bbp->current_reply_id ) && ( bbp_get_reply_post_type() != get_post_field( 'post_type', $bbp_reply_id ) ) ) 235 $bbp->current_reply_id = null; 234 236 235 237 return apply_filters( 'bbp_get_reply_id', (int) $bbp_reply_id, $reply_id ); -
branches/plugin/bbp-includes/bbp-topic-template.php
r2970 r2972 293 293 */ 294 294 function bbp_get_topic_id( $topic_id = 0 ) { 295 global $bbp, $wp_query , $bbp;295 global $bbp, $wp_query; 296 296 297 297 // Easy empty checking … … 305 305 // Currently viewing a topic 306 306 elseif ( ( bbp_is_topic() || bbp_is_topic_edit() ) && isset( $wp_query->post->ID ) ) 307 $bbp_topic_id = $wp_query->post->ID; 307 $bbp_topic_id = $bbp->current_topic_id = $wp_query->post->ID; 308 309 // Currently viewing a topic 310 elseif ( bbp_is_reply() ) 311 $bbp_topic_id = $bbp->current_topic_id = bbp_get_reply_topic_id(); 308 312 309 313 // Fallback … … 311 315 $bbp_topic_id = 0; 312 316 313 $bbp->current_topic_id = $bbp_topic_id; 317 // Check if current_reply_id is set, and check post_type if so 318 if ( !empty( $bbp->current_topic_id ) && ( bbp_get_topic_post_type() != get_post_field( 'post_type', $bbp_topic_id ) ) ) 319 $bbp->current_topic_id = null; 314 320 315 321 return apply_filters( 'bbp_get_topic_id', (int) $bbp_topic_id, $topic_id ); -
branches/plugin/bbpress.php
r2964 r2972 146 146 * @var string Current forum id 147 147 */ 148 var $current_forum_id ;148 var $current_forum_id = null; 149 149 150 150 /** 151 151 * @var string Current topic id 152 152 */ 153 var $current_topic_id ;153 var $current_topic_id = null; 154 154 155 155 /** 156 156 * @var string Current reply id 157 157 */ 158 var $current_reply_id ;158 var $current_reply_id = null; 159 159 160 160 /** User ******************************************************************/
Note: See TracChangeset
for help on using the changeset viewer.