Making WordPress.org

Changeset 10388


Ignore:
Timestamp:
10/19/2020 04:36:28 AM (5 years ago)
Author:
dd32
Message:

BudyPress: Another edgecase of URI parsing for redirects. ^/community/$ => /support/.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/buddypress.org/public_html/wp-content/plugins/buddypress-org/extensions.php

    r10361 r10388  
    9393    }
    9494
    95     // Redirect /forums/ to /support/
    96     if ( $uri_chunks[1] === 'forums' && empty( $uri_chunks[2] ) ) {
     95    // Redirect /forums/ to /support/ & /community/ to /support
     96    if ( ( $uri_chunks[1] === 'forums' || $uri_chunks[1] === 'community' ) && empty( $uri_chunks[2] ) ) {
    9797        bp_core_redirect( home_url( '/support/' ) );
    9898    }
     
    103103    }
    104104
    105     // Redirect old members profile pages to
     105    // Redirect old members profile pages to their new location
    106106    if ( ( $uri_chunks[1] === 'community' ) && ( $uri_chunks[2] === 'members' ) && ! empty( $uri_chunks[3] ) ) {
    107107        bp_core_redirect( home_url( '/members/' . $uri_chunks[3] . '/' ) );
     
    109109
    110110    // Redirect old plugin groups to deprecated plugin forums
    111     if ( ( $uri_chunks[1] === 'community' ) && isset( $uri_chunks[2] ) && ( $uri_chunks[2] === 'groups' ) ) {
     111    if ( ( $uri_chunks[1] === 'community' ) && ( $uri_chunks[2] === 'groups' ) ) {
    112112
    113113        // /community/groups/ to Support root.
Note: See TracChangeset for help on using the changeset viewer.