Navigation überspringen

[Gelöst] Query all custom fields' value into array

This support ticket is created vor 3 Jahre, 7 Monaten. 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
- 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)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Luo Yang vor 3 Jahre, 7 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#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.