Changeset 1468 for sites/trunk/buddypress.org/public_html/wp-content/plugins/buddypress-org/extensions.php
- Timestamp:
- 04/03/2015 01:01:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/buddypress.org/public_html/wp-content/plugins/buddypress-org/extensions.php
r499 r1468 91 91 // Redirect /forums/ to /support/ 92 92 if ( $uri_chunks[1] === 'forums' && empty( $uri_chunks[2] ) ) { 93 bp_core_redirect( 'http://buddypress.org/support/');93 bp_core_redirect( home_url( '/support/' ) ); 94 94 } 95 95 96 96 // Redirect members directory to root to block heavy paginated user queries 97 97 if ( ( $uri_chunks[1] === 'members' ) && empty( $uri_chunks[2] ) ) { 98 bp_core_redirect( 'http://buddypress.org');98 bp_core_redirect( home_url( '/' ) ); 99 99 } 100 100 101 101 // Redirect old members profile pages to 102 102 if ( ( $uri_chunks[1] === 'community' ) && ( $uri_chunks[2] === 'members' ) && ! empty( $uri_chunks[3] ) ) { 103 bp_core_redirect( 'http://buddypress.org/members/' . $uri_chunks[3] . '/');103 bp_core_redirect( home_url( '/members/' . $uri_chunks[3] . '/' ) ); 104 104 } 105 105 … … 109 109 // Single group topic redirect 110 110 if ( !empty( $uri_chunks[5] ) && ( $uri_chunks[5] === 'topic' ) ) { 111 bp_core_redirect( 'http://buddypress.org/support/topic/' . $uri_chunks[6] . '/');111 bp_core_redirect( home_url( '/support/topic/' . $uri_chunks[6] . '/' ) ); 112 112 113 113 // Single group forum redirect … … 116 116 // Use legacy group slug 117 117 if ( ! in_array( $uri_chunks[3], array( 'gallery', 'how-to-and-troubleshooting' ) ) ) { 118 bp_core_redirect( 'http://buddypress.org/support/forum/plugin-forums/' . $uri_chunks[3] . '/');118 bp_core_redirect( home_url( '/support/forum/plugin-forums/' . $uri_chunks[3] . '/' ) ); 119 119 120 120 // Root forums, maybe with new slug … … 124 124 switch ( $uri_chunks[3] ) { 125 125 case 'gallery' : 126 $url = ' http://buddypress.org/support/forum/your-buddypress/';126 $url = '/support/forum/your-buddypress/'; 127 127 break; 128 128 case 'how-to-and-troubleshooting' : 129 $url = ' http://buddypress.org/support/forum/how-to/';129 $url = '/support/forum/how-to/'; 130 130 break; 131 131 case 'creating-and-extending' : 132 $url = ' http://buddypress.org/support/forum/extending/';132 $url = '/support/forum/extending/'; 133 133 break; 134 134 case 'requests-and-feedback' : 135 $url = ' http://buddypress.org/support/forum/feedback/';135 $url = '/support/forum/feedback/'; 136 136 break; 137 137 case 'buddypress' : 138 $url = ' http://buddypress.org/support/forum/installing/';138 $url = '/support/forum/installing/'; 139 139 break; 140 140 case 'third-party-plugins' : 141 $url = ' http://buddypress.org/support/forum/plugins/';141 $url = '/support/forum/plugins/'; 142 142 break; 143 143 default: … … 145 145 break; 146 146 } 147 bp_core_redirect( $url);147 bp_core_redirect( home_url( $url ) ); 148 148 } 149 149 } … … 152 152 // Redirect /support/topics/ to /support/ 153 153 if ( $uri_chunks[1] === 'support' && ( !empty( $uri_chunks[2] ) && ( 'topics' === $uri_chunks[2] ) ) ) { 154 bp_core_redirect( 'http://buddypress.org/support/');155 } 156 } 157 if ( 'buddypress.org' === $_SERVER['HTTP_HOST']&& ! is_admin() && defined( 'WP_USE_THEMES' ) && WP_USE_THEMES ) {154 bp_core_redirect( home_url( '/support/' ) ); 155 } 156 } 157 if ( (bool) strstr( $_SERVER['HTTP_HOST'], 'buddypress' ) && ! is_admin() && defined( 'WP_USE_THEMES' ) && WP_USE_THEMES ) { 158 158 add_action( 'init', 'bporg_redirect', 1 ); // before bp_init 159 159 }
Note: See TracChangeset
for help on using the changeset viewer.