Changeset 3409 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
- Timestamp:
- 06/17/2016 12:04:06 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r3408 r3409 2 2 namespace WordPressdotorg\Plugin_Directory; 3 3 use WordPressdotorg\Plugin_Directory\Admin\Customizations; 4 use WordPressdotorg\Plugin_Directory\CLI\Tag_To_Category; 4 5 5 6 /** … … 567 568 568 569 // [1] => plugins [2] => example-plugin-name [2..] => random() 569 $plugin_slug = explode( '/', $_SERVER['REQUEST_URI'] )[2]; 570 571 if ( $plugin = self::get_plugin_post( $plugin_slug ) ) { 570 $path = explode( '/', $_SERVER['REQUEST_URI'] ); 571 572 if ( 'tags' === $path[2] ) { 573 if ( isset( Tag_To_Category::$map[ $path[3] ] ) ) { 574 wp_safe_redirect( home_url( '/category/' . Tag_To_Category::$map[ $path[3] ] . '/' ) ); 575 die(); 576 } else if ( isset( $path[3] ) ) { 577 wp_safe_redirect( home_url( '/search/' . $path[3] . '/' ) ); 578 die(); 579 } else { 580 wp_safe_redirect( home_url( '/' ) ); 581 die(); 582 } 583 } 584 585 if ( $plugin = self::get_plugin_post( $path[2] ) ) { 572 586 $is_disabled = in_array( $plugin->post_status, array( 'disabled', 'closed' ), true ); 573 587
Note: See TracChangeset
for help on using the changeset viewer.