[buddypress-trac] [BuddyPress Trac] #8320: 404 error for the next page after loading any BuddyPress page
buddypress-trac
noreply at wordpress.org
Wed May 22 06:00:30 UTC 2024
#8320: 404 error for the next page after loading any BuddyPress page
--------------------------+------------------------------
Reporter: dmcsupport | Owner: (none)
Type: defect (bug) | Status: new
Priority: high | Milestone: Awaiting Review
Component: Core | Version: 6.0.0
Severity: critical | Resolution:
Keywords: |
--------------------------+------------------------------
Comment (by gujjarhere):
The issue you're experiencing with random 404 pages appearing after
loading BuddyPress pages seems to be related to a known compatibility
problem between BuddyPress and certain WordPress themes or configurations.
Based on the provided sources, the issue arises when BuddyPress modifies
the global $wp_query object to load its own pages, but doesn't properly
restore it afterwards. This can cause subsequent non-BuddyPress pages to
throw 404 errors.
{{{
function bp_fix_404_issue() {
if ( ! is_buddypress() && $GLOBALS['wp_query']->is_404() ) {
status_header( 200 );
}
}
add_action( 'wp', 'bp_fix_404_issue' );
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8320#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list