Making WordPress.org


Ignore:
Timestamp:
02/09/2024 03:15:54 AM (13 months ago)
Author:
dd32
Message:

Plugin Directory: Allow tags to be filtered by taxonomies.

This adjusts the styles and templates to simplify the behaviour, allowing for an "empty" archive to be displayed.

Closes https://github.com/WordPress/wordpress.org/pull/198.
See #7430.

File:
1 edited

Legend:

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

    r13195 r13196  
    13611361        // Existing tag with no plugins.
    13621362        if (
    1363             ( is_tax() || is_category() || is_tag() ) &&
     1363            is_tax( 'plugin_tags' ) &&
    13641364            ! have_posts() &&
    1365             ! is_tax( 'plugin_section' ) // All sections have something, or intentionally don't (favorites)
     1365            // Only redirect if only plugin_tags is queried. Other taxonomies cannot be handled.
     1366            count( $wp_query->tax_query->queried_terms ) <= 1
    13661367        ) {
    13671368            // [1] => plugins [2] => tags [3] => example-plugin-name [4..] => random().
     
    13751376        // This may occur due to WordPress's 1600 character search limit.
    13761377        if (
    1377                 'search' === get_query_var( 'name' ) ||
    1378                 ( isset( $_GET['s'] ) && ! get_query_var( 's' ) ) ||
    1379                 ( is_search() && 0 === strlen( get_query_var( 's' ) ) )
     1378            'search' === get_query_var( 'name' ) ||
     1379            ( isset( $_GET['s'] ) && ! get_query_var( 's' ) ) ||
     1380            ( is_search() && 0 === strlen( get_query_var( 's' ) ) )
    13801381        ) {
    13811382            wp_safe_redirect( site_url( '/' ), 301 );
Note: See TracChangeset for help on using the changeset viewer.