Skip to:
Content

BuddyPress.org

Changeset 7471


Ignore:
Timestamp:
10/23/2013 07:54:07 PM (13 years ago)
Author:
boonebgorges
Message:

Don't canonical redirect page_on_front if bp_current_action() is populated

When looking at a BP component and bp_current_action() is empty, it means that
the item is (1) not a single item (like a group or member), and (2) not a feed
request. Therefore, it's a good way to infer whether a page is a directory
page, and ought to be considered for redirecting to directory page_on_front
settings.

This fixes the problem of /activity/feed/ being redirected to the front page
when the Activity directory was set to page_on_front.

Fixes #5211

Props r-a-y

File:
1 edited

Legend:

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

    r7437 r7471  
    629629
    630630                // If requesting the front page component directory, canonical
    631                 // URL is the front page
    632                 if ( false !== $front_page_component && is_page( $page_on_front ) ) {
     631                // URL is the front page. We detect whether we're detecting a
     632                // component *directory* by checking that bp_current_action()
     633                // is empty - ie, this not a single item or a feed
     634                if ( false !== $front_page_component && bp_is_current_component( $front_page_component ) && ! bp_current_action() ) {
    633635                        $bp->canonical_stack['canonical_url'] = trailingslashit( bp_get_root_domain() );
    634636
Note: See TracChangeset for help on using the changeset viewer.