Thank you for the confirmation.
During testing on my own website, I was able to make this search type filter work, but with a limitation, that it works only with the view that shows updated search results, through page reload and not AJAX.
This means that in the view's "Custom Search Settings" section, you'll need to select an option that reloads the page.
( screenshot: enlace oculto )
Here are the steps:
1. Since the "IEA CCC Authors 2" custom taxonomy is not needed, please remove it form custom taxonomies (Toolset -> Taxonomies) and also its filter from the view's "Query Filter" section.
2. Please also remove the extra author selector field's code from the "Search and Pagination" section, as we only need one field for authors now.
( screenshot: enlace oculto )
3. Adjust the query filter for the taxonomy, so that by default, it brings any of the matched values (OR).
( screenshot: enlace oculto )
4. In the "Search and Pagination" section, include the code of a custom search field, that will allow visitors to select the search operation type for authors.
( i.e. "Any of the selected" (OR) or "All of the selected" (AND) )
<div class="form-group">
<label for="wpv-author-search-type">Author Search Type</label>
<select id="wpv_control_select_wpcf-author-search-type" name="wpv-author-search-type" class="js-wpv-filter-trigger form-control">
[wpv-conditional if="( '[wpv-search-term param="wpv-author-search-type"]' eq '' ) OR ( '[wpv-search-term param="wpv-author-search-type"]' eq 'IN' )"]
<option value="IN" selected="selected">Any of the selected</option>
<option value="AND">All of the selected</option>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-search-term param="wpv-author-search-type"]' eq 'AND' )"]
<option value="IN">Any of the selected</option>
<option value="AND" selected="selected">All of the selected</option>
[/wpv-conditional]
</select>
</div>
Note: This custom search field will automatically show the correct selected option after the page will reload as a result of the search form's submission, using the conditional output blocks ( ref: https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/ ) and the "wpv-search-term" shortcode ( ref: https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-search-term ).
5. To change the search operation type for this taxonomy field, based on the user's selection, you'll need to use a custom function hooked to "wpv_filter_query" filter ( ref: https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query ).
add_filter( 'wpv_filter_query', 'filter_emp_date_custom_fn', 1000 , 3 );
function filter_emp_date_custom_fn( $view_args, $view_settings, $view_id ) {
if ( ( !is_admin() && isset($view_settings['view_id'] ) ) && ( ($view_settings['view_id'] == 12345) ) )
{
if ( (empty($_GET['wpv-author-search-type'])) || (!isset($_GET['wpv-author-search-type'])) ) {
$author_search_operator = 'IN';
}
else
{
$author_search_operator = $_GET['wpv-author-search-type'];
}
if ( !empty( $view_args['tax_query']) ) {
$view_args['tax_query'][0]['operator'] = $author_search_operator;
}
}
return $view_args;
}
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file and replacing "12345" with the actual ID of the view.
I hope this helps and please let me know if any step is not clear.