Making WordPress.org

Changeset 13652


Ignore:
Timestamp:
05/02/2024 07:20:09 AM (7 months ago)
Author:
dd32
Message:

Revert [13648].

File:
1 edited

Legend:

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

    r13648 r13652  
    217217        // These are the things that jetpack_search_es_wp_query_args doesn't let us change, so we need to filter the es_query_args late in the code path to add more custom stuff.
    218218
    219         // Replace any existing filter with an AND for our custom filters.
    220         $es_query_args['filter'] = [
    221             'and' => $es_query_args['filter'] ? [ $es_query_args['filter'] ] : [],
    222         ];
    223 
    224         // Exclude 'disabled' plugins. This is separate from the 'status' field, which is used for the plugin status.
    225         $es_query_args['filter']['and'] = [
    226             'terms' => [
    227                 'disabled' => false,
     219        $es_query_args['filter']['and'] ??= [];
     220
     221        // Exclude disabled plugins.
     222        $es_query_args['filter']['and'][] = [
     223            'term' => [
     224                'disabled' => [
     225                    'value' => false,
     226                ],
    228227            ]
    229228        ];
    230229
    231         // Limit to the Block Directory.
    232230        if ( $this->is_block_search ) {
     231            // Limit to the Block Tax.
    233232            $es_query_args['filter']['and'][] = [
    234                 'terms' => [
    235                     'taxonomy.plugin_section.name' => 'block',
     233                'term' => [
     234                    'taxonomy.plugin_section.name' => [
     235                        'value' => 'block'
     236                    ]
    236237                ]
    237238            ];
Note: See TracChangeset for help on using the changeset viewer.