I see following view is used on the following page: payed view 9980 (Search-results-clean-payed)
- hidden link
And for that there is custom filter added as you wanted to filter based on the user selected category with code snippet "toolset-custom-code":
add_filter('wpv_filter_query', 'func_user_selected_city_listing_cat', 99, 3);
function func_user_selected_city_listing_cat($query_args, $setting, $view_id) {
if ($view_id == 9980 && is_user_logged_in() && pms_is_member()) {
global $current_user;
$user_id = $current_user->ID;
if (isset($_GET['cred_referrer_form_id']) && !isset($_GET['wpv_view_count'])) {
$user_city = get_user_meta($user_id, 'city', true);
$user_listing_category = get_user_meta($user_id, 'listing_category', true);
// Initialize meta_query if it doesn't exist
if (!isset($query_args['meta_query'])) {
$query_args['meta_query'] = array();
}
$query_args['meta_query'] = array(
'relation' => 'OR'
);
if ($user_city) {
$query_args['meta_query'][] = array(
'key' => 'city',
'value' => $user_city,
'type' => 'CHAR',
'compare' => '='
);
}
if ($user_listing_category) {
$query_args['meta_query'][] = array(
'key' => 'wpv-listing_category',
'value' => $user_listing_category,
'type' => 'CHAR',
'compare' => '='
);
$query_args['meta_query'][] = array(
'taxonomy' => 'listing_category',
'field' => 'id',
'terms' => $user_listing_category,
'operator' => 'IN'
);
}
}
}
return $query_args;
}
As you wanted to prefilter the view with the user selected term that is why its not showing the term you mention with the screenshot.
Also - as per my solution provided before if you notice the solution with the following ticket, there is tax_query and meta_query added.:
- https://toolset.com/forums/topic/split-user-stored-preference-data-changes-search-results-generic-field-default-value-edit-form/#post-2709430
But as you may notice with the current code, someone added like this, there is no tax_query, I'm not sure why.
$query_args['meta_query'][] = array(
'key' => 'wpv-listing_category',
'value' => $user_listing_category,
'type' => 'CHAR',
'compare' => '='
);
$query_args['meta_query'][] = array(
'key' => 'wpv-listing_category',
'value' => $user_listing_category,
'type' => 'CHAR',
'compare' => '='
);
[/php]
I suggest you should debug this further and correct it as per your requirement.