Tell us what you are trying to do?
Hi. I'm trying to use a FacetWP proximity facet to filter posts based on the address stored from a Toolset address field. It appears that the facet isn't seeing the stored coordinates. I looked in the database and it appears the coords are stored in an interesting way... I checked with FacetWP support and they said if I can find out how the data is stored I can use an indexer hook to tell FacetWP how to index the lat and long.
Is there any documentation that you are following?
No
Is there a similar example that we can see?
Yes, but would prefer to keep private.
What is the link to your site?
Would prefer to keep private during development.
Hi,
Thank you for contacting us and I'd be happy to assist.
If your goal is to get the raw latitude and longitude values from the Toolset's address type custom field, you can use the Toolset Types API:
https://toolset.com/documentation/customizing-sites-using-php/functions/#address
For example, suppose that you need a comma-separated latitude and longitude value from the address field with slug 'post-location', from post with ID "123".
The "types_render_field" function, in this case, will be used as:
$field_value = types_render_field( 'post-location', array( 'item' => 123, 'format' => 'FIELD_LATITUDE,FIELD_LONGITUDE' ) );
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Hi Waqar,
I'm still trying to make sense of this, have not solved the problem, and am only replying on a Saturday because your "cleanup robot" prompted me to do so... Please don't close this ticket yet.
Thanks,
Eric
Hi Eric,
This ticket will remain open for a couple of weeks, so you're welcome to share any follow-up questions or concerns.
regards,
Waqar