Skip Navigation

[Resolved] How can I refernce a custom field created in TYPES in a PHP program?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by Pastor Walt 9 years, 4 months ago.

Assisted by: Caridad.

Author
Posts
#270919

The website I am working on is a single internet site serving a church with that has multiple physical locations we call campuses. There are 5 campuses all at different locations. I am trying to use a PHP program that will run as a widget and select a specific post defined as a location for a specific campus in order to be able to pull the various custom fields from the tabler based on the name of the campus, whih itself is a custom field. The problem is I don't know how to reference these custom fields in a native PHP environment.

#271004

You could PHP mysql functions to query the database directly:

SELECT meta_value FROM wp_postmeta WHERE post_id = 1 AND meta_key = 'wpcf-custom-field-name'

Please let me know if you are satisfied with my reply and any other questions you may have.

Regards,
Caridad

#271128

Thank you. This opened up a whole new understanding of the custom fields processing with in WordPress and enabled me to use this understanding in a couple of widgets I was writing.

The forum ‘Types Community Support’ is closed to new topics and replies.

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