Making WordPress.org

Changeset 8946


Ignore:
Timestamp:
06/13/2019 09:57:50 AM (5 years ago)
Author:
tellyworth
Message:

Plugin dir: add Block browse option.

For future use.

File:
1 edited

Legend:

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

    r8918 r8946  
    496496
    497497        // Add the browse/* views.
    498         add_rewrite_tag( '%browse%', '(featured|popular|beta|blocks|new|favorites|adopt-me)' );
     498        add_rewrite_tag( '%browse%', '(featured|popular|beta|blocks|block|new|favorites|adopt-me)' );
    499499        add_permastruct( 'browse', 'browse/%browse%' );
    500500
     
    732732        // For any invalid values passed to browse, set it to featured instead
    733733        if ( !empty ( $wp_query->query ['browse'] ) &&
    734              !in_array( $wp_query->query['browse'], array( 'featured', 'popular', 'beta', 'blocks', 'new', 'favorites', 'adopt-me' ) ) ) {
     734             !in_array( $wp_query->query['browse'], array( 'featured', 'popular', 'beta', 'blocks', 'block', 'new', 'favorites', 'adopt-me' ) ) ) {
    735735             $wp_query->query['browse'] = 'featured';
    736736             $wp_query->query_vars['browse'] = 'featured';
     
    776776
    777777        // For /browse/ requests, we conditionally need to avoid querying the taxonomy for most views (as it's handled in code above)
    778         if ( isset( $wp_query->query['browse'] ) && ! in_array( $wp_query->query['browse'], array( 'beta', 'blocks', 'featured', 'adopt-me' ) ) ) {
     778        if ( isset( $wp_query->query['browse'] ) && ! in_array( $wp_query->query['browse'], array( 'beta', 'blocks', 'block', 'featured', 'adopt-me' ) ) ) {
    779779            unset( $wp_query->query_vars['browse'] );
    780780
Note: See TracChangeset for help on using the changeset viewer.