Skip to:
Content

BuddyPress.org

Changeset 13522


Ignore:
Timestamp:
07/20/2023 03:07:17 AM (11 months ago)
Author:
imath
Message:

Do the homepage directory check only when the requested URL is home

Fixes #8939
See #4954
Closes https://github.com/buddypress/buddypress/pull/133

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-component.php

    r13503 r13522  
    482482        }
    483483
    484         if ( bp_is_directory_homepage( $this->id ) ) {
     484        if ( home_url( '/' ) === bp_get_requested_url() && bp_is_directory_homepage( $this->id ) ) {
    485485            $query->set( $this->rewrite_ids['directory'], 1 );
    486486        }
  • trunk/src/bp-blogs/classes/class-bp-blogs-component.php

    r13505 r13522  
    461461        $bp = buddypress();
    462462
    463         if ( bp_is_directory_homepage( $this->id ) ) {
     463        if ( home_url( '/' ) === bp_get_requested_url() && bp_is_directory_homepage( $this->id ) ) {
    464464            $query->set( $this->rewrite_ids['directory'], 1 );
    465465        }
  • trunk/src/bp-core/bp-core-catchuri.php

    r13471 r13522  
    564564         */
    565565        if ( false !== $front_page_component && bp_is_current_component( $front_page_component ) && ! bp_current_action() && ! bp_get_current_member_type() ) {
    566             $bp->canonical_stack['canonical_url'] = bp_get_root_url();
     566            $bp->canonical_stack['canonical_url'] = trailingslashit( bp_get_root_url() );
    567567
    568568        // Except when the front page is set to the registration page
  • trunk/src/bp-core/bp-core-filters.php

    r13503 r13522  
    977977
    978978            $post = (object) array(
    979                 'ID'                    => $directory->id,
     979                'ID'                    => (int) $directory->id,
    980980                'post_author'           => 0,
    981981                'post_date'             => $null,
  • trunk/src/bp-groups/classes/class-bp-groups-component.php

    r13521 r13522  
    10531053        }
    10541054
    1055         if ( bp_is_directory_homepage( $this->id ) ) {
     1055        if ( home_url( '/' ) === bp_get_requested_url() && bp_is_directory_homepage( $this->id ) ) {
    10561056            $query->set( $this->rewrite_ids['directory'], 1 );
    10571057        }
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r13512 r13522  
    791791        }
    792792
    793         if ( bp_is_directory_homepage( $this->id ) ) {
     793        if ( home_url( '/' ) === bp_get_requested_url() && bp_is_directory_homepage( $this->id ) ) {
    794794            $query->set( $this->rewrite_ids['directory'], 1 );
    795795        }
Note: See TracChangeset for help on using the changeset viewer.