Changeset 15329
- Timestamp:
- 10/14/2026 11:30:55 AM (9 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
r15191 r15329 29 29 add_action( 'init', array( $this, 'add_rewrite_rules' ) ); 30 30 31 // Run after bbp_parse_query() (priority 2) has flagged user pages. 32 add_action( 'parse_query', array( $this, 'reset_singular_flags_on_user_pages' ), 20 ); 31 33 32 34 // Add bbPress support to the WordPress.org SEO plugin. … … 191 193 if ( ! is_admin() && 'forum' === $query->get( 'post_type' ) ) { 192 194 $query->set( 'post_status', 'publish' ); 195 } 196 } 197 198 /** 199 * Clear the singular flags on bbPress user pages. 200 * 201 * A stray `?page_id=` or `?pagename=` makes WP_Query flag the request as a page, 202 * and bbPress keeps those flags when it takes over the query for a user page. 203 * With no post to back them, get_body_class() then reads a null queried object. 204 * 205 * @param WP_Query $query Current query object. 206 */ 207 public function reset_singular_flags_on_user_pages( $query ) { 208 if ( $query->is_main_query() && ! empty( $query->bbp_is_single_user ) ) { 209 $query->is_page = false; 210 $query->is_singular = false; 211 $query->is_single = false; 193 212 } 194 213 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)