Home › Forums › Add-ons › Gallery Field › Display Field Label For Gallery Add-on › Reply To: Display Field Label For Gallery Add-on
Hi @makeitminnesota,
Thank you for the question.
You can make use of the get_field_obejct function to return an array of the field object as seen in the field group edit screen.
In your scenario, you can apply the function as follow:
/*
* Get a field object and display it with it's value (using the field key and the value fron another post)
*/
$field_key = "field_5039a99716d1d";
$post_id = 123;
$field = get_field_object($field_key, $post_id);
echo $field['label'] . ': ' . $field['value'];
You can have a look at this resource page for more info on this.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.