Changeset 12347
- Timestamp:
- 12/20/2022 02:36:14 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r11580 r12347 63 63 // Tell WordPress not to 404 (before bbPress overrides it) so that Canonical can do it's job. 64 64 add_filter( 'pre_handle_404', array( $this, 'abort_wp_handle_404' ) ); 65 66 // Let plugins know which forum we're in. 67 add_filter( 'bbp_get_forum_id', array( $this, 'bbp_get_forum_id' ) ); 68 65 69 } 66 70 } … … 727 731 } 728 732 733 /** 734 * These compat routes are views, but showing a singular forum. 735 * This makes other plugins understand that the compat view is a forum. 736 * 737 * @param int $forum_id The detected forum id. 738 * @return int The actual forum id. 739 */ 740 public function bbp_get_forum_id( $forum_id ) { 741 if ( ! $forum_id && bbp_is_single_view() ) { 742 if ( $this->compat() === bbp_get_view_id() ) { 743 $forum_id = $this->forum_id(); 744 } elseif ( 'reviews' == bbp_get_view_id() ) { 745 $forum_id = Plugin::REVIEWS_FORUM_ID; 746 } 747 } 748 749 return $forum_id; 750 } 729 751 730 752 /**
Note: See TracChangeset
for help on using the changeset viewer.