Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/21/2012 02:18:49 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Introduce _bp_maybe_remove_redirect_canonical() as a stop-gap to prevent WordPress from confusing BuddyPress faux URLs with existing rewrite rule matches. See #4029.

File:
1 edited

Legend:

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

    r5813 r5817  
    589589add_action( 'bp_core_pre_load_template', 'bp_redirect_canonical' );
    590590
     591/**
     592 * Remove WordPress's really awesome canonical redirect if we are trying to load
     593 * BuddyPress specific content. Avoids issues with WordPress thinking that a
     594 * BuddyPress URL might actually be a blog post or page.
     595 *
     596 * This function should be considered temporary, and may be removed without
     597 * notice in future versions of BuddyPress.
     598 *
     599 * @since BuddyPress (1.6)
     600 * @uses bp_is_blog_page()
     601 */
     602function _bp_maybe_remove_redirect_canonical() {
     603    if ( ! bp_is_blog_page() )
     604        remove_action( 'template_redirect', 'redirect_canonical' );
     605}
     606add_action( 'bp_init', '_bp_maybe_remove_redirect_canonical' );
     607
    591608?>
Note: See TracChangeset for help on using the changeset viewer.