Skip Navigation

[Résolu] Query all custom fields' value into array

This support ticket is created Il y a 2 années et 5 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 1 réponse, has 2 voix.

Last updated by Luo Yang Il y a 2 années et 5 mois.

Assisted by: Luo Yang.

Auteur
Publications
#2226233
Screenshot 2021-11-22 at 12.51.02 AM.png

Dear Sir/Madam,

I have a custom post 'invoice' which contain several custom fields, how can I query all the custom fields' value into an array?

best regards,

Kelvin.

#2226571

Hello,

I assume you are going to get all custom field values from one post with custom PHP codes, if it is, please try WP function get_post_meta(), for example:

$meta = get_post_meta( get_the_ID() );

More help:
https://developer.wordpress.org/reference/functions/get_post_meta/
$key
(string) (Optional) The meta key to retrieve. By default, returns data for all keys.

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