Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not do any weighting query modifications if there is nothing in config #2512

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion includes/classes/Feature/Search/Weighting.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ public function do_weighting( $formatted_args, $args ) {
*/
$weight_config = apply_filters( 'ep_weighting_configuration_for_search', $weight_config, $args );

if ( Utils\is_integrated_request( 'weighting', [ 'public', 'rest' ] ) && ! empty( $args['s'] ) ) {
if ( ! empty( $weight_config ) && ! has_filter( 'ep_weighted_query_for_post_type' ) && ! has_filter( 'ep_weighting_default_post_type_weights' ) && ! has_filter( 'ep_weighting_default_enabled_taxonomies' )
&& Utils\is_integrated_request( 'weighting', [ 'public', 'rest' ] ) && ! empty( $args['s'] ) ) {
/*
* This section splits up the single query clause for all post types into separate nested clauses (one for each post type)
* which then get combined into one result set. By having separate clauses for each post type, we can then
Expand Down