Changeset 2972 for branches/plugin/bbp-includes/bbp-topic-template.php
- Timestamp:
- 04/01/2011 03:00:10 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 );
Note: See TracChangeset
for help on using the changeset viewer.