Skip to:
Content

BuddyPress.org

Changeset 5970


Ignore:
Timestamp:
04/09/2012 09:36:06 PM (8 years ago)
Author:
boonebgorges
Message:

During the catchuri process, manually set wp_rewrite->use_verbose_page_rules to false after we have verified that we are viewing a BuddyPress page.

Once BP has done its own matching against bp_pages, there is no need to allow WP to do a check against get_page_by_path() to ensure that the requested page exists - particularly when WP's check will fail, due to BP's unorthodox URI structure. Thus this changeset will fix the problem of WP_Query returning a 404 status when permalinks are set to /%postname%/.
Fixes #4086

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-catchuri.php

    r5954 r5970  
    3838 */
    3939function bp_core_set_uri_globals() {
    40     global $bp, $current_blog;
    41 
     40    global $bp, $current_blog, $wp_rewrite;
     41   
    4242    // Don't catch URIs on non-root blogs unless multiblog mode is on
    4343    if ( !bp_is_root_blog() && !bp_is_multiblog_mode() )
     
    157157        }
    158158    }
    159 
     159   
    160160    // No exact match, so look for partials
    161161    if ( empty( $match ) ) {
     
    228228
    229229    // This is not a BuddyPress page, so just return.
    230     if ( !isset( $matches ) )
     230    if ( empty( $matches ) )
    231231        return false;
     232
     233    $wp_rewrite->use_verbose_page_rules = false;
    232234
    233235    // Find the offset. With $root_profile set, we fudge the offset down so later parsing works
Note: See TracChangeset for help on using the changeset viewer.