WordPress.org

Making WordPress.org

Changeset 3504


Ignore:
Timestamp:
06/20/2016 02:18:09 PM (2 years ago)
Author:
tellyworth
Message:

Search: filter on tested-up-to >= 4.0.

See #1692

File:
1 edited

Legend:

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

    r3494 r3504  
    264264            // plugin directory specific:
    265265            'date_range'     =>  array( 'field' => 'modified', 'gte' => $date_cutoff, 'lte' => $date_today ),
     266            'tested_range'   =>  array( 'field' => 'meta.tested.value', 'gte' => '4.0' ),
    266267        );
    267268
     
    453454   
    454455            'date_range'     => null,    // array( 'field' => 'date', 'gt' => 'YYYY-MM-dd', 'lte' => 'YYYY-MM-dd' ); date formats: 'YYYY-MM-dd' or 'YYYY-MM-dd HH:MM:SS'
     456            'tested_range'   => null,
    455457   
    456458            'orderby'        => null,    // Defaults to 'relevance' if query is set, otherwise 'date'. Pass an array for multiple orders.
     
    527529            unset( $args['date_range']['field'] );
    528530            $filters[] = array( 'range' => array( $field => $args['date_range'] ) );
     531        }
     532
     533        if ( !empty( $args['tested_range'] ) && isset( $args['tested_range']['field'] ) ) {
     534            $field = $args['tested_range']['field'];
     535            unset( $args['tested_range']['field'] );
     536            $filters[] = array( 'range' => array( $field => $args['tested_range'] ) );
    529537        }
    530538   
     
    704712                        'exists' => array(
    705713                            'field' => 'meta.active_installs.long'
    706                         )
     714                        ),
    707715                 )
    708716            )
Note: See TracChangeset for help on using the changeset viewer.