Support

Account

Home Forums General Issues Defining field wrapper ID Reply To: Defining field wrapper ID

  • Yes. For example, say I have a repeater containing a text field, and on the edit page I add 5 repeater rows. I want to target the text fields and give them each a unique wrapper ID.

    Currently my code looks like this:-

    
    function my_acf_load_field( $field )
    {
        $field['wrapper'] = array(
            'id' => 'unique_id'
        );
    
        return $field;
    }
    	
    	add_filter('acf/load_field/key=field_123', 'my_acf_load_field');
    

    With field_123 being the text field. But this will give all 5 text fields the same ID: ‘unique_id’. What I would like is for each text field to have a sequential ID. for example “unique_id_1′, ‘unique_id_2’… etc.

    Any ideas?