Support

Account

Home Forums Bug Reports Prefixed clone field in repeater not working

Helping

Prefixed clone field in repeater not working

  • Hi,

    I’m trying to use the clone field inside of a repeater, but can’t seem to get the field separately. Both get_field and get_sub_field don’t return anything when asking for the prefixed field.

    Set-up:

    Field-group: CTA Button

    • Field: Type (select) [link, url]
    • Field: Text (text)
    • Field: Link (page link) {conditional: type == link}
    • Field: URL (url) {conditional: type == url}

    Field-group: Sections

    • Field: Sections (repeater)
      • Subfield: CTA (clone: all fields in CTA Button group) [display: group] {prefix field names: cta_%field_name%}
    
    <?php
    if (have_rows('sections')): while(have_rows('sections')): the_row();
        var_dump(get_sub_field('cta')); // array [type, text, link, url]
        var_dump(get_sub_field('cta_text')); // false
        var_dump(get_field('cta_text')); // null
    endwhile; endif;
    ?>
    
  • Have you submitted a new support ticket on this? https://support.advancedcustomfields.com/new-ticket/. If you haven’t then you should.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Prefixed clone field in repeater not working’ is closed to new replies.