Home › Forums › General Issues › Foreach Tab › Reply To: Foreach Tab
Tabs are not actually fields and are not stored. The fields in each tab are not associated with the tab in any way. Tabs are just an admin layout feature of ACF. So really, there is nothing in ACF itself that will allow you to do this.
If I found myself needing to do this I would probably create a nested array that defined the fields I wanted to show for each tab and then loop through that array to create the foreach tab effect, something like:
$array = (
array(
// these are the field names for tab 1
'name_1',
'name_2',
'name_3',
'name_4'
),
array(
// these are the field names for tab 2
'name_5',
'name_6',
'name_7',
'name_8'
)
)
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.