This thread is resolved. Here is a description of the problem and solution.
Problem:
How to filter view by custom field of third party plugin/theme which stores serialize data.
Solution:
You can use 'wpv_filter_query" filter to filter your view with custom fields with serialize data.
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class. That means you can add/remove query on fly.
I'm trying to add "Query Filter" for a custom field set by the theme that I purchased. The problem is, I don't know how to filter custom field having multiple values (see database under postmeta table and views query filter, screenshot attached).
Hello. Thank you for contacting the Toolset support.
You can not filter view with such field which have multiple values using views filter. For such field I suggest you need to use view's filter hook: 'wpv_filter_query".
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class. That means you can add/remove query on fly.
For example:
add_filter( 'wpv_filter_query', 'limit_time_on_query', 99, 3 );
function limit_time_on_query($query_args, $view_setting, $view_id)
{
if ($view_id == 999) {
/// ADJUST your query_arguments with your meta query here as per your custom field as meta key and meta values here
}
return $query_args;
}
Where:
Please change "999" with your original view id.