Making WordPress.org

Changeset 5206


Ignore:
Timestamp:
03/30/2017 07:28:30 AM (7 years ago)
Author:
dd32
Message:

Plugin Directory: Rearrange the rewrite rules to allow access to /search/admin, and remove the wp-admin auto-redirect on /admin$ 404 requests.

Fixes #2625.

File:
1 edited

Legend:

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

    r5192 r5206  
    436436        add_rewrite_rule( '^browse/favorites/([^/]+)$', 'index.php?browse=favorites&favorites_user=$matches[1]', 'top' );
    437437
     438        // Add duplicate search rule which will be hit before the following old-plugin tab rules
     439        add_rewrite_rule( '^search/([^/]+)/?$', 'index.php?s=$matches[1]', 'top' );
     440
    438441        // Handle plugin admin requests
    439442        add_rewrite_rule( '^([^/]+)/admin/?$', 'index.php?name=$matches[1]&plugin_admin=1', 'top' );
    440443
    441         // Add duplicate search rule which will be hit before the following old-plugin tab rules
    442         add_rewrite_rule( '^search/([^/]+)/?$', 'index.php?s=$matches[1]', 'top' );
    443 
    444444        // Handle the old plugin tabs URLs.
    445445        add_rewrite_rule( '^([^/]+)/(installation|faq|screenshots|changelog|stats|developers|other_notes)/?$', 'index.php?redirect_plugin=$matches[1]&redirect_plugin_tab=$matches[2]', 'top' );
     
    447447        // If changing capabilities around, uncomment this.
    448448        //Capabilities::add_roles();
     449
     450        // Remvoe the /admin$ redirect to wp-admin
     451        remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
    449452
    450453        // When this plugin is used in the context of a Rosetta site, handle it gracefully.
Note: See TracChangeset for help on using the changeset viewer.