Making WordPress.org

Changeset 10408


Ignore:
Timestamp:
10/26/2020 06:44:04 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Restore the /browse/updated route, but don't link to it.

Fixes #2631.

File:
1 edited

Legend:

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

    r10407 r10408  
    525525
    526526        // Add the browse/* views.
    527         add_rewrite_tag( '%browse%', '(featured|popular|beta|blocks|block|new|favorites|adopt-me)' );
     527        add_rewrite_tag( '%browse%', '(featured|popular|beta|blocks|block|new|favorites|adopt-me|updated)' );
    528528        add_permastruct( 'browse', 'browse/%browse%' );
    529529
     
    780780        // For any invalid values passed to browse, set it to featured instead
    781781        if ( !empty ( $wp_query->query ['browse'] ) &&
    782              !in_array( $wp_query->query['browse'], array( 'featured', 'popular', 'beta', 'blocks', 'block', 'new', 'favorites', 'adopt-me' ) ) ) {
     782             !in_array( $wp_query->query['browse'], array( 'featured', 'popular', 'beta', 'blocks', 'block', 'new', 'favorites', 'adopt-me', 'updated' ) ) ) {
    783783             $wp_query->query['browse'] = 'featured';
    784784             $wp_query->query_vars['browse'] = 'featured';
     
    816816                    $wp_query->query_vars['p'] = -1;
    817817                }
     818                break;
     819
     820            case 'updated':
     821                $wp_query->query_vars['orderby'] = 'modified_date';
    818822                break;
    819823
Note: See TracChangeset for help on using the changeset viewer.