Home › Forums › Add-ons › Repeater Field › Repeater – Instruction placement › Reply To: Repeater – Instruction placement
Posting my workaround here in case it’s of use to anyone stumbling across this issue. First I use acf/load_field
to move the instructions to a new item in the array and empty the instructions item, checking first to see if this is a child of my repeater field. Then I filter the output of all fields using acf/render_field
to see if there’s an ‘instructions_below’ item in the array and output it after the input.
add_filter( 'acf/load_field', 'tweak_repeater_instructions' );
function tweak_repeater_instructions( $field ) {
if( 'group_123xyz' !== $field['parent'] ) return $field;
$field['instructions_below'] = $field['instructions'];
$field['instructions'] = '';
return $field;
}
add_filter( 'acf/render_field', 'position_repeater_instructions' );
function position_repeater_instructions( $field ) {
if( ! isset( $field['instructions_below'] ) ) return;
echo '<p class="description">'.$field['instructions_below'].'</p>';
}
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.