Home › Forums › ACF PRO › Difference btw Group and Flexible field? › Reply To: Difference btw Group and Flexible field?
A Group field is almost identical to a repeater field. A group field is a repeater that always has exactly one row.
if (have_rows('group_field')) {
will always return true.
The other difference is that get_field('repeater')
will return
array(
0 => array(
'sub_field_1_name' => 'sub_field_1_value'
'sub_field_2_name' => 'sub_field_2_value'
),
1 => array(
'sub_field_1_name' => 'sub_field_1_value'
'sub_field_2_name' => 'sub_field_2_value'
)
)
and get_field('group_field')
will return
array(
'sub_field_1_name' => 'sub_field_1_value'
'sub_field_2_name' => 'sub_field_2_value'
)
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.