Support

Account

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>';
    }