_bp_maybe_remove_redirect_canonical

Remove WP's canonical redirect when we are trying to load BP-specific content.

Description

_bp_maybe_remove_redirect_canonical(); 

Avoids issues with WordPress thinking that a BuddyPress URL might actually be a blog post or page.

This function should be considered temporary, and may be removed without notice in future versions of BuddyPress.


Usage

  1. if ( !function_exists( '_bp_maybe_remove_redirect_canonical' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-catchuri.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = _bp_maybe_remove_redirect_canonical(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-catchuri.php  
  1. function _bp_maybe_remove_redirect_canonical() { 
  2. if ( ! bp_is_blog_page() ) 
  3. remove_action( 'template_redirect', 'redirect_canonical' );