diff --git a/wp-job-manager-functions.php b/wp-job-manager-functions.php index 51d8e370d..400a8a089 100644 --- a/wp-job-manager-functions.php +++ b/wp-job-manager-functions.php @@ -351,6 +351,7 @@ function job_manager_construct_secondary_conditions( $search_term, $is_excluding $not_string = $is_excluding ? 'NOT ' : ''; $conditions = []; + $meta_value = $wildcard_search . $wpdb->esc_like( $search_term ) . $wildcard_search; /** * Can be used to disable searching post meta for job searches. @@ -359,7 +360,6 @@ function job_manager_construct_secondary_conditions( $search_term, $is_excluding */ if ( apply_filters( 'job_listing_search_post_meta', true ) ) { - $meta_value = $wildcard_search . $wpdb->esc_like( $search_term ) . $wildcard_search; // Only selected meta keys. if ( $searchable_meta_keys ) { $meta_keys = implode( "','", array_map( 'esc_sql', $searchable_meta_keys ) );