Skip Navigation

[Closed] Populating custom fields with php

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 8 years, 8 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 – 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)

This topic contains 1 reply, has 2 voices.

Last updated by Caridad 8 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#326459

Hi! I am trying to populate custom fields from a php file.

Currently I am populating my custom fields using a csv import, but not all the data is correctly formatted. I want to add a few filters in my content.php file before displaying the fields so that they are correctly formatted. I already have the filters programmed and can display the correct information. However I haven't found out how to change the information in the types CF's from this php file. The problem now is that I'm displaying the correct information but cant use my search functionality to find it, as its not corrected in the custom fields.

How could I populate a types field from my php file?

#326619

You can use standard WordPress functions to manipulate custom field data:

https://developer.wordpress.org/reference/functions/get_post_meta/
https://developer.wordpress.org/reference/functions/update_post_meta/

The only thing you need to keep in mind is that we prefix the meta key with wpcf-

So for example if your field is called "date" you should use the key "wpcf-date" to get/set its value.

Regards
Caridad

The topic ‘[Closed] Populating custom fields with php’ is closed to new replies.