Changeset 2147847 – WordPress Plugin Repository
- ️Thu Aug 29 2019
Legend:
- Unmodified
- Added
- Removed
-
elasticpress/trunk/elasticpress.php
r2144033 r2147847 3 3 * Plugin Name: ElasticPress 4 4 * Description: A fast and flexible search and query engine for WordPress. 5 * Version: 3.1.3 5 * Version: 3.1.4 6 6 * Author: 10up 7 7 * Author URI: http://10up.com … … 28 28 define( 'EP_URL', plugin_dir_url( __FILE__ ) ); 29 29 define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); 30 define( 'EP_VERSION', '3.1.3' ); 30 define( 'EP_VERSION', '3.1.4' ); 31 31 32 32 /** -
elasticpress/trunk/includes/classes/Elasticsearch.php
r2140802 r2147847 212 212 ); 213 213 214 // If search, send the search term as a header to ES 215 if ( isset( $query_args['s'] ) && (bool) $query_args['s'] && ! is_admin() ) { 214 // If search, send the search term as a header to ES so the backend understands what a normal query looks like 215 if ( isset( $query_args['s'] ) && (bool) $query_args['s'] && ! is_admin() && ! isset( $_GET['post_type'] ) ) { 216 216 $request_args['headers']['EP-Search-Term'] = $query_args['s']; 217 217 } -
elasticpress/trunk/includes/classes/Feature/Facets/Facets.php
r2144033 r2147847 263 263 $tax_query = $query->get( 'tax_query', [] ); 264 264 265 // Account for taxonomies that should be woocommerce attributes, if WC is enabled 266 $attribute_taxonomies = []; 267 if ( function_exists( 'wc_attribute_taxonomy_name' ) ) { 268 $all_attr_taxonomies = wc_get_attribute_taxonomies(); 269 270 foreach ( $all_attr_taxonomies as $attr_taxonomy ) { 271 $attribute_taxonomies[ $attr_taxonomy->attribute_name ] = wc_attribute_taxonomy_name( $attr_taxonomy->attribute_name ); 272 } 273 } 274 265 275 foreach ( $selected_filters['taxonomies'] as $taxonomy => $filter ) { 266 276 $tax_query[] = [ 267 'taxonomy' => wc_attribute_taxonomy_name( $taxonomy ), 277 'taxonomy' => isset( $attribute_taxonomies[ $taxonomy ] ) ? $attribute_taxonomies[ $taxonomy ] : $taxonomy, 268 278 'field' => 'slug', 269 279 'terms' => array_keys( $filter['terms'] ), … … 292 302 $GLOBALS['ep_facet_aggs'] = []; 293 303 294 foreach ( $response['aggregations']['terms'] as $key => $agg ) { 295 if ( 'doc_count' === $key ) { 296 continue; 297 } 298 299 $GLOBALS['ep_facet_aggs'][ $key ] = []; 300 301 foreach ( $agg['buckets'] as $bucket ) { 302 $GLOBALS['ep_facet_aggs'][ $key ][ $bucket['key'] ] = $bucket['doc_count']; 304 if ( isset( $response['aggregations']['terms'] ) && is_array( $response['aggregations']['terms'] ) ) { 305 foreach ( $response['aggregations']['terms'] as $key => $agg ) { 306 if ( 'doc_count' === $key ) { 307 continue; 308 } 309 310 $GLOBALS['ep_facet_aggs'][ $key ] = []; 311 312 foreach ( $agg['buckets'] as $bucket ) { 313 $GLOBALS['ep_facet_aggs'][ $key ][ $bucket['key'] ] = $bucket['doc_count']; 314 } 303 315 } 304 316 } -
elasticpress/trunk/includes/classes/Indexable/Post/Post.php
r2144033 r2147847 689 689 $use_filters = true; 690 690 } elseif ( ! empty( $args['author_name'] ) ) { 691 // Since this was set to use the display name initially, there might be some code that used this feature. 692 // Let's ensure that any query vars coming in using author_name are in fact slugs. 693 $author_login = sanitize_user( $args['author_name'] ); 691 694 $filter['bool']['must'][] = array( 692 695 'term' => array( 693 'post_author.raw' => $args['author'], 696 'post_author.login.raw' => $author_login, 694 697 ), 695 698 ); … … 1334 1337 if ( ! empty( $args['meta_key'] ) ) { 1335 1338 $sort[] = array( 1336 'meta.' . $args['meta_key'] . '.value' => array( 1339 'meta.' . $args['meta_key'] . '.raw' => array( 1337 1340 'order' => $order, 1338 1341 ), -
elasticpress/trunk/includes/classes/Indexable/User/User.php
r2144033 r2147847 572 572 if ( ! empty( $query_vars['meta_key'] ) ) { 573 573 $sort[] = array( 574 'meta.' . $query_vars['meta_key'] . '.value' => array( 574 'meta.' . $query_vars['meta_key'] . '.raw' => array( 575 575 'order' => $order, 576 576 ), -
elasticpress/trunk/includes/dashboard.php
r2127416 r2147847 38 38 add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\action_admin_enqueue_admin_scripts' ); 39 39 add_action( 'admin_init', __NAMESPACE__ . '\action_admin_init' ); 40 add_action( 'plugins_loaded', __NAMESPACE__ . '\maybe_clear_es_info_cache' ); 40 add_action( 'admin_init', __NAMESPACE__ . '\maybe_clear_es_info_cache' ); 41 41 add_action( 'wp_ajax_ep_index', __NAMESPACE__ . '\action_wp_ajax_ep_index' ); 42 42 add_action( 'wp_ajax_ep_notice_dismiss', __NAMESPACE__ . '\action_wp_ajax_ep_notice_dismiss' ); … … 166 166 } 167 167 168 if ( empty( $_GET['ep-retry'] ) && ! in_array( Screen::factory()->get_current_screen(), [ 'dashboard', 'settings' ], true ) ) { // phpcs:ignore WordPress.Security.NonceVerification 168 if ( empty( $_GET['ep-retry'] ) && ! in_array( Screen::factory()->get_current_screen(), [ 'dashboard', 'settings', 'install' ], true ) ) { // phpcs:ignore WordPress.Security.NonceVerification 169 169 return; 170 170 } … … 286 286 foreach ( $notices as $notice_key => $notice ) { 287 287 ?> 288 <div data-ep-notice="<?php echo esc_attr( $notice_key ); ?>" class="notice notice-<?php echo esc_attr( $notice['type'] ); ?> <?php if ( $notice['dismiss'] ) : ?>is-dismissible<?php endif; ?>"> 288 <div data-ep-notice="<?php echo esc_attr( $notice_key ); ?>" class="notice notice-<?php echo esc_attr( $notice['type'] ); ?> <?php 289 if ( $notice['dismiss'] ) : 290 ?> 291 is-dismissible<?php endif; ?>"> 289 292 <p> 290 293 <?php echo wp_kses( $notice['html'], 'ep-html' ); ?>
Note: See TracChangeset for help on using the changeset viewer.