New home › Forums › Pro Add-on › Pull different fields from ACF into maps custom fields
Tagged: ACF
- This topic has 4 replies, 2 voices, and was last updated 1 year, 8 months ago by Steven.
-
AuthorPosts
-
March 7, 2022 at 10:49 pm #72401moises8Participant
Greetings,
We already did the tutorial for the ACF integration and the map is showing all our offices as intended on the map, but its general data (title, address, link to post).
I was wondering if it was possible to add another field from ACF to the map markers, in this case we want to pull the phone number from our custom fields into the maps custom fields so that it gets shown into the map.
As i was looking through the forum i found that there’s a custom code to add the description to the map data, but we dont need the description from the post in our case.
case ‘description’:
$query->fields[$field] = “( SELECT post_content FROM {$wpdb->prefix}posts WHERE ID = post_id AND post_status = ‘publish’ ) AS $field”; break;And also if its possible to make that phone information into a link, so that it behaves like a phone link on the browser
Regards
Attachments:
You must be logged in to view attached files.March 8, 2022 at 3:01 pm #72406StevenModeratorHi @moises8,
Thank you so much for getting in touch, we really appreciate your time.
Unfortunately, this is not yet possible, however, this is something we are presently working on.
Unfortunately, custom field data for example is stored in a different table so requires adjustments to the query in order to query the post_meta table. The issue, however, is that in doing so, this data then needs to be cross referenced so it causes a dramatic performance drops for each time this query is fired.
With that said, we are hoping to incorporate this in a future version of WP Google Maps as soon as we are able.
I hope this helps to clarify?
Kindest Regards,
Steven De BeerMarch 8, 2022 at 7:35 pm #72407moises8ParticipantHi Steven,
Thanks for the answer, well we’ll look forward to that, if you maybe have a roadmap or a date when such a feature could be release?
Also would it be possible to add the description as well to the map?
I tried this from another post:
to wp-content/plugins/wp-google-maps-pro/includes/3rd-party-integration/class.acf.php line 271:
case ‘description’:
$query->fields[$field] = “( SELECT post_content FROM {$wpdb->prefix}posts WHERE ID = post_id AND post_status = ‘publish’ ) AS $field”; break;But the descriptions doesn’t appear
March 9, 2022 at 1:05 am #72411moises8ParticipantNever mind, it worked!
My only doubt left would be if you maybe have a roadmap or a date when such a feature could be release?
March 9, 2022 at 8:38 am #72420StevenModeratorHi @moises8,
Thank you so much for getting back to me.
This is currently on the roadmap for our next major version which we are hoping to get released within the next few months.
If I am not mistaken, this feature has been dramatically improved in the new major version with a host of core code changes already and should definitely help in in the future.
Kindest Regards,
Steven De Beer -
AuthorPosts
- You must be logged in to reply to this topic.