Skip Navigation

[Resolved] Add API support for Custom Field Types

This thread is resolved. Here is a description of the problem and solution.

Problem:
Add API support for Custom Field Types

Solution:
There is no such feature available yet.

you can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/add-api-support-for-custom-field-types/#post-955521

Relevant Documentation:

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 5 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#952332

Hi guys

I bought the Toolset package today and love the way it generates Custom Post / Field Types but I've found one major issue for me to continue my Agency Subscription.

At my company we build websites using Laravel + WordPress for Content Management. I've been using free 'Custom Post Type-plugins' for previous websites. All of them work well and have the possibility to expose Custom Field Types to the API.

None of them have the possibility to add a Google Maps field-group to a Custom Post Type and that's the main reason I switched to the Agency Subscription of Toolset.

Is there in any other way a solution to expose Custom Field Types to the API until you're ready to release this feature? I desperately need this feature. No matter what it takes ?

Please help me!

Kind regards
Yannick

#952341

UPDATE:

I've successfully exposed Custom Fields using the 'WP REST API Controller WordPress-plugin'.

As I mentioned in my previous message, I would like to use the Google Maps feature of Toolset to add addresses to Custom Post Types. Right now the API only exposes the address title and not the latitude and longitude.

Is it possible to expose those coordinates as well? This would solve everything for me.

Thanks!

#953525

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - we do not store the address lat-long but we cache the map's address. Please check following Doc:
=> https://toolset.com/documentation/user-guides/data-caching-for-google-maps-addresses/

If you want to display the lat-long for any address, you should use the following shortcode:

[types field='field-slug' format='FIELD_LATITUDE, FIELD_LONGITUDE'][/types]
#955515

Hi Minesh

Where should I place this code?

Is this code to view the LAT and LONG in my admin dashboard?

Thanks!

#955521

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - lets say you have a post which has address field setup with value.

If you add the shortcode to that post body and load the post on frontend - you will see the lat-long.

[types field='field-slug' format='FIELD_LATITUDE, FIELD_LONGITUDE'][/types]

If you want to display same using Types PHP API function - you should use following way:

echo types_render_field("my-address", array('format'=>'FIELD_LATITUDE, FIELD_LONGITUDE'));

More info:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#address

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.