Home › Forums › Front-end Issues › Absolute display of all fields › Reply To: Absolute display of all fields
Hi @vguenichon
Here’s some code that I managed to get working to display details about the sub fields within a repeater:
Note: I left my debugging statements intact, but commented out.
<?php
// repeater field - this can be set dynamically within your loop of course... I set it statically for testing
$field_obj = get_field_object( 'field_59dbae70e1416' );
if ( $field_obj ) {
if ( $field_obj['type'] == 'repeater' ) {
// the array of sub fields within the repeater
$sub_fields = $field_obj['sub_fields'];
foreach( $sub_fields as $sub_field ) {
echo '<p>key: ' . $sub_field['key'] . '<br />';
echo 'label: ' . $sub_field['label'] . '<br />';
echo 'name: ' . $sub_field['name'] . '</p>';
}
//echo '<pre>';
//print_r($sub_fields);
//echo '</pre>';
}
}
?>
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.