Home › Forums › Add-ons › Flexible Content Field › How to get label for › Reply To: How to get label for
Do you mean the label for the flex layout? I’m not sure that there is, at least I’ve never seen anything that suggest that it would be easy. Layouts are stored as part of the field definition. Do an export to code and you can see how it’s stored. Each layout is an array. You would need to use get_field_object() to get the flex field and then loop through the “layouts” sub array to find the one with that layout “name” and output the “label” value of that array element.
Hopefully that makes sense after you look at the output of exporting.
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.