PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.1
Forumax – AI Powered Advanced Community Forum Plugin v2.5.1
2.5.1 2.5.0 2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 All 31 releases
← All changes | lib/bbpress/includes/topics/template.php +6 -2 2.4.1 → 2.5.1 View file →
@@ -480,14 +480,18 @@
480 480 // Currently inside a search loop
481 481 } elseif ( ! empty( $bbp->search_query->in_the_loop ) && isset( $bbp->search_query->post->ID ) && bbp_is_topic( $bbp->search_query->post->ID ) ) {
482 482 $bbp_topic_id = $bbp->search_query->post->ID;
483 483
484 - // Currently viewing/editing a topic, likely alone
485 - } elseif ( ( bbp_is_single_topic() || bbp_is_topic_edit() ) && ! empty( $bbp->current_topic_id ) ) {
484 + // Topic ID already set by a shortcode / theme-compat render
485 + } elseif ( ! empty( $bbp->current_topic_id ) ) {
486 486 $bbp_topic_id = $bbp->current_topic_id;
487 487
488 488 // Currently viewing/editing a topic, likely in a loop
489 489 } elseif ( ( bbp_is_single_topic() || bbp_is_topic_edit() ) && isset( $wp_query->post->ID ) ) {
490 + $bbp_topic_id = $wp_query->post->ID;
491 +
492 + // Main query is a topic even if single-topic flags are not set yet
493 + } elseif ( isset( $wp_query->post->post_type ) && ( bbp_get_topic_post_type() === $wp_query->post->post_type ) ) {
490 494 $bbp_topic_id = $wp_query->post->ID;
491 495
492 496 // Currently viewing/editing a reply
493 497 } elseif ( bbp_is_single_reply() || bbp_is_reply_edit() ) {