Making WordPress.org


Ignore:
Timestamp:
04/05/2017 04:50:33 AM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Rename the Admin section to Advanced and enable all users to view it (including logged out anonymous users).

See #2365

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r5217 r5248  
    440440
    441441        // Handle plugin admin requests
    442         add_rewrite_rule( '^([^/]+)/admin/?$', 'index.php?name=$matches[1]&plugin_admin=1', 'top' );
     442        add_rewrite_rule( '^([^/]+)/advanced/?$', 'index.php?name=$matches[1]&plugin_advanced=1', 'top' );
    443443
    444444        // Handle the old plugin tabs URLs.
     
    961961        $vars[] = 'redirect_plugin';
    962962        $vars[] = 'redirect_plugin_tab';
    963         $vars[] = 'plugin_admin';
     963        $vars[] = 'plugin_advanced';
    964964
    965965        return $vars;
     
    10501050            }
    10511051
     1052            // Browse 404's
     1053            if ( 'browse' === $path[2] ) {
     1054                wp_safe_redirect( home_url( '/browse/featured/' ) );
     1055                die();
     1056            }
     1057
    10521058            // Otherwise, handle a plugin redirect.
    10531059            if ( $path[2] && ( $plugin = self::get_plugin_post( $path[2] ) ) ) {
     
    10721078        }
    10731079
    1074         // Filter access to the plugin administration area. Only certain users are allowed access.
    1075         if ( get_query_var( 'plugin_admin' )  &&
    1076             ! current_user_can(
    1077                 'plugin_admin_view',
    1078                 $post = Plugin_Directory::get_plugin_post( get_query_var( 'name' ) )
    1079             )
    1080         ) {
    1081             wp_safe_redirect( get_permalink( $post ) );
    1082             die();
    1083         }
    10841080    }
    10851081
Note: See TracChangeset for help on using the changeset viewer.