I don't know how much support I'm gonna get for this, but I figured I'd try and at least ask. So I'm using GeoDirectory (hidden link) as a location directory management platform. This site was originally built with only GeoDirectory in mind, and I am now being tasked with incorporating Toolset components to help manage the archives and post views as Toolset gives us greater control over the look and structure of the loop output. That being the case, I've run into a snag with their custom fields. They don't store the data in the postmeta table, thereby keeping me from being able to use the "Hidden Custom Fields" setting in Toolset's settings.
Since their data is all in its own separate table (geodir_gd_place_detail), I was wondering if there was a way to get Toolset to recognize the table as post meta data for use in Views and Query Filters. While I'm pretty sure I can cook up my own shortcodes to pull the information I need from the database for use in the view output, I'm not sure how to filter the output based on their custom fields.
What is the link to your site?
hidden link
Hello,
There isn't such kind of built-in feature within Toolset Blocks/Views plugins, since those values are saved in other custom database table "geodir_gd_place_detail", Toolset Plugins won't get the values from that database table.
You might consider custom codes, for example, use wpv_filter_query filter hook to apply custom query codes:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
Ok, thank you.
Would you be able to give an example that would show how retrieve data from a specific field using the wpv_filter_query hook? That'll at least get me started in the right direction.
I have started on a means to pull the data, but it seems the filter I'm injecting has no label. Do you know how to resolve this?
This is my code so far:
add_filter('wpv_filter_query', 'get_featured_status');
function get_featured_status() {
global $wp_query;
$postid = $wp_query->post->ID;
$data = geodir_get_post_meta($postid, 'featured', true);
//Output GeoDirectory Data
return $data;
}
As I mentioned above, Toolset Plugins won't get the values from that database table.
According to our support policy, we don't provide such kind of custom codes support:
https://toolset.com/toolset-support-policy/
You can also check it with our Toolset certified consultants:
https://toolset.com/contractors/