Support

Account

Home Forums General Issues Iterate through tab fields

Helping

Iterate through tab fields

  • Curious if anyone knows a good way to iterate though each of the tab fields for a given page or post, and (for example) output the tab name?

  • Tabs are an input layout feature to aid in making post editing more user friendly and not something meant to be used on the front end of the site.

    But it would be possible. The only way that I can think of to do this would be to get the fields in the field group and loop through the fields to find the tabs, display the labels and then display the fields until you get to the next tab.

    I’m not sure this is a documented function, but I’ve used it when building plugins to extend ACF.

    $fields = get_field_group($group_key);

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Iterate through tab fields’ is closed to new replies.