Changeset 9187
- Timestamp:
- 10/16/2019 04:08:07 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r9160 r9187 471 471 472 472 register_meta( 'post', 'assets_icons', array( 473 'type' => ' array',473 'type' => 'UserDefinedarray', 474 474 'description' => __( 'Icon images of the plugin.', 'wporg-plugins' ), 475 475 'single' => true, … … 1199 1199 // Handle a redirect for /$plugin/$tab_name/ to /$plugin/#$tab_name. 1200 1200 if ( get_query_var( 'redirect_plugin' ) && get_query_var( 'redirect_plugin_tab' ) ) { 1201 wp_safe_redirect( site_url( get_query_var( 'redirect_plugin' ) . '/#' . get_query_var( 'redirect_plugin_tab' ) ) );1201 wp_safe_redirect( site_url( get_query_var( 'redirect_plugin' ) . '/#' . get_query_var( 'redirect_plugin_tab' ) ), 301 ); 1202 1202 die(); 1203 1203 } … … 1206 1206 if ( is_404() ) { 1207 1207 1208 // [1] => plugins [2] => example-plugin-name [ 2..] => random().1208 // [1] => plugins [2] => example-plugin-name [3..] => random(). 1209 1209 $path = explode( '/', $_SERVER['REQUEST_URI'] ); 1210 1210 1211 1211 if ( 'tags' === $path[2] ) { 1212 1212 if ( isset( $path[3] ) && ! empty( $path[3] ) ) { 1213 wp_safe_redirect( home_url( '/search/' . urlencode( $path[3] ) . '/' ) );1213 wp_safe_redirect( home_url( '/search/' . urlencode( $path[3] ) . '/' ), 301 ); 1214 1214 die(); 1215 1215 } else { 1216 wp_safe_redirect( home_url( '/' ) );1216 wp_safe_redirect( home_url( '/' ), 301 ); 1217 1217 die(); 1218 1218 } … … 1222 1222 if ( 'about' === $path[2] ) { 1223 1223 if ( isset( $path[3] ) && 'add' == $path[3] ) { 1224 wp_safe_redirect( home_url( '/developers/add/' ) );1224 wp_safe_redirect( home_url( '/developers/add/' ), 301 ); 1225 1225 } elseif ( isset( $path[3] ) && 'validator' == $path[3] ) { 1226 wp_safe_redirect( home_url( '/developers/readme-validator/' ) );1226 wp_safe_redirect( home_url( '/developers/readme-validator/' ), 301 ); 1227 1227 } else { 1228 wp_safe_redirect( home_url( '/developers/' ) );1228 wp_safe_redirect( home_url( '/developers/' ), 301 ); 1229 1229 } 1230 1230 die(); … … 1233 1233 // Browse 404s. 1234 1234 if ( 'browse' === $path[2] ) { 1235 wp_safe_redirect( home_url( '/' ) );1235 wp_safe_redirect( home_url( '/' ), 301 ); 1236 1236 die(); 1237 1237 } … … 1249 1249 $permalink = get_permalink( $plugin->ID ); 1250 1250 if ( parse_url( $permalink, PHP_URL_PATH ) != $_SERVER['REQUEST_URI'] ) { 1251 wp_safe_redirect( $permalink );1251 wp_safe_redirect( $permalink, 301 ); 1252 1252 die(); 1253 1253 } … … 1256 1256 // Otherwise, let's redirect to the search page. 1257 1257 if ( isset( $path[2] ) && ! empty( $path[2] ) ) { 1258 wp_safe_redirect( home_url( '/search/' . urlencode( $path[2] ) . '/' ) );1258 wp_safe_redirect( home_url( '/search/' . urlencode( $path[2] ) . '/' ), 301 ); 1259 1259 die(); 1260 1260 } … … 1297 1297 // disable feeds 1298 1298 if ( is_feed() ) { 1299 if ( isset( $_GET['feed'] ) ) {1299 if ( isset( $_GET['feed'] ) ) { 1300 1300 wp_redirect( esc_url_raw( remove_query_arg( 'feed' ) ), 301 ); 1301 1301 die();
Note: See TracChangeset
for help on using the changeset viewer.