Making WordPress.org

Changeset 11649


Ignore:
Timestamp:
03/08/2022 04:27:03 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Search: Some code formatting cleanup, documenting of variable values, disabling debug logging.

See #1496.

File:
1 edited

Legend:

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

    r11163 r11649  
    55add_filter( 'option_has_jetpack_search_product', '__return_true' );
    66
    7 
    87/**
    9  ** Override Jetpack Search class with special features for the Plugin Directory
    10  **
    11  ** @package WordPressdotorg\Plugin_Directory
    12  **/
     8 * Override Jetpack Search class with special features for the Plugin Directory
     9 *
     10 * @package WordPressdotorg\Plugin_Directory
     11 */
    1312class Plugin_Search {
    1413
     
    1615    const USE_OLD_SEARCH = false;
    1716
    18     // Internal state
    19     protected $locale;
    20     protected $is_block_search;
    21     protected $is_english;
    22     protected $en_boost;
    23     protected $desc_boost;
    24     protected $desc_en_boost;
     17    // Internal state - These are all overridden below, but here for reference purposes for a non-block english search.
     18    protected $locale          = 'en_US';
     19    protected $is_block_search = false;
     20    protected $is_english      = true;
     21    protected $en_boost        = 0.00001;
     22    protected $desc_boost      = 1;
     23    protected $desc_en_boost   = 0.00001;
    2524
    2625    /**
     
    6766            add_filter( 'pre_option_has_jetpack_search_product', array( $this, 'option_has_jetpack_search_product' ), 10, 1 );
    6867
    69             add_filter( 'jetpack_search_abort', array( $this, 'log_jetpack_search_abort' ) );
     68            // add_filter( 'jetpack_search_abort', array( $this, 'log_jetpack_search_abort' ) );
    7069
    7170            require_once( ABSPATH . 'wp-content/plugins/jetpack/modules/search/class.jetpack-search.php' );
     
    152151
    153152        if ( $this->is_english ) {
    154             $matching_fields      = array(
     153            $matching_fields = array(
    155154                'all_content_en',
    156155            );
    157156        } else {
    158             $matching_fields      = array(
     157            $matching_fields = array(
    159158                'all_content_' . $this->locale,
    160159                'all_content_en^' . $this->en_boost,
     
    163162
    164163        $args['query_fields'] = $matching_fields;
    165 
    166 
    167 
    168164
    169165        return $args;
Note: See TracChangeset for help on using the changeset viewer.