Support

Account

Home Forums Bug Reports ACF Pro – Options pages with Repeaters not working

Solving

ACF Pro – Options pages with Repeaters not working

  • ACF PRO v. 5.3.2.2 on WordPress 4.3

    Options Page with a Repeater field is not working – doing a get_field(‘repeaterfield’,’option’); returns the number of rows instead of the usual array of sub-fields. have_rows(‘repeaterfield’, ‘option’) while or ifs do not work at all. This appears to be a bug.

  • I just did a quick test with 5.3.2.2 and get_field is returning an array for both posts and options.

    Have you tried the normal things, deactivating other plugins, changing themes? I’d also try uploading a fresh copy of ACF.

    If this doesn’t help then I’d suggest opening a new support ticket http://support.advancedcustomfields.com/new-ticket/

  • I’m seeing this same issue in 5.3.3

  • ACF Pro 5.3.3.1

    I’m doing a new build and I’m having the same issue. The repeater field is returning the number of items in the array and not the array.

    while( have_rows('repeater_field_name','option') ): the_row();
    // do stuff
    endwhile;

    This test fails – actual field name is different.

    It’s possible this is a conflict with the theme I’m using for this project. GeoPlaces from Templatic. Their code does not always place nicely.

  • This is an update to my prior post. This issue is not with ACF but its the theme. I created clean test install of Twenty Fifteen, added ACF Pro, added my code from my current project. ACF worked without issue. I don’t know if this helps anyone, but it’s one less place to look for answers.

  • If you know how to parse values from a WordPress database object you can query the options page. I have a repeating field called slides on a options page. It has three subfields slide_image, slide_caption, slide_link. I got the array length by using this code.

    $my_count = $wpdb->get_results($wpdb->prepare("SELECT 'option_value' FROM '$wpdb->options' WHERE 'option_name' = 'options_slides' "));

    In my case this returned:

    [0] => stdClass Object ( [option_value] => 6 )

    next to get the all the subfields I used this query:

    $my_rows = $wpdb->get_results($wpdb->prepare("SELECT * FROM '$wpdb->options' WHERE 'option_name' REGEXP '^(options_slides)' "));

    which returns (partial example)

    [0] => stdClass Object
            (
                [option_id] => 35462
                [option_name] => options_slides_0_slide_image
                [option_value] => 13282
                [autoload] => yes
            )
    
        [1] => stdClass Object
            (
                [option_id] => 35464
                [option_name] => options_slides_0_slide_caption
                [option_value] => <h2>My Caption Title</h2>
    Discover Portland's best restaurants, bars, cafes and bakeries
                [autoload] => yes
            )
    
        [2] => stdClass Object
            (
                [option_id] => 35466
                [option_name] => options_slides_0_slide_link
                [option_value] => http://mywebsite.com/placecategory/food-drink/
                [autoload] => yes
            )

    options_slides_0_slide_image is from the options page. options_slides_0_slide_image is your repeating field name. options_slides_0_slide_image is the number of the element in the array. options_slides_0_slide_image is the name of the subfield in the repeater. Since I have 6 repeating fields the last image slide is options_slides_5_slide_image. This is my be very geeky, but maybe it will help. These comments are only related to version 5.x. For MySQL queries us a prime character ` not a single quote .

  • I ended up reverting back to ACF 5.3.1 and my issue was fixed, so I believe this is just a bug that was introduced in the last couple of versions.

    With regards to the direct query idea, while this could technically work, I would consider this more of a hack since you’re not future proofing your site for possible data structure changes that the ACF team might implement in the future.

  • If you have gone through the normal troubleshooting steps… deactivating other plugins, switching to a default theme, etc… and the problem persists, and it is also cleared up in an earlier version of ACF then I would suggest

    submitting a support ticket

    http://support.advancedcustomfields.com/new-ticket/

    These forums are for getting help from other users and a support ticket is a more direct route to getting bugs corrected.

  • I have already submitted a ticket, but those aren’t as visible to external users. I wanted to give @imageDESIGN hope that they weren’t alone. 🙂

  • I also saw this problem yesterday. I have not changed anything that is material from my point of view. Certainly there were neither plugin or theme changes that could be relevant

    For me it does not always happen. Re activating ACF Pro helped a c0uple of times, but I cannot understand the pattern.

  • Hi

    Was there any progress on this point yet? I’m rather blocked by it as it breaks my site when the repeater on the option page is mucked up because get_fields doesn’t return the content but just the array length.

    Or perhaps a workaround?

    Thanks, David

  • I’ve just tried this again on a test site with the current version of ACF Pro and I’m not seeing the issue. I get the array.

    I’ve thought of one more thing it might be, but it’s a long shot.

    What is the name of the repeater and the sub fields? Is the repeater nested in another repeater of flex field? Are there other nested repeaters? So basically, what are the names of all the fields in the repeater hierarchy that’s giving you a problem?

  • Hi John

    Thanks for the idea. Here are the field name and subfields:

    Repeater: “Fields”
    Subfields:
    – template
    – input_field
    – mappings
    – function
    – output_field
    – local_output
    – export_output
    – back_end

    I actually access the repeater “fields” using “field_nnn” notation, though, as I thought this might be an issue.

    Thanks, David

  • I thought that the generated “option_name” for the fields might be too long, that that should not be the case. with these field names.

    Like I said, I’ve tried this several times and if I do get_field('repeater_name', 'options'); it always returns an array for me. I just tried using the field key with the same result.

    The last thing that might cause this in ACF is the name of the repeater field itself. Do you have any other fields on any other options page with the same name as the repeater fields? Field names used on options pages must be unique site wide.

  • Hi John

    I don’t think I have any duplicated option field names, at least not intentionally. What is the case, is that I have a “tab” field with the same name as the “repeater”, but this was not a problem in the past, and I didn’t think that tab fields create data fields as such.

    My phone screen is a bit small to check the field names. I’ll do it later on when I have my laptop.

    The field name “fields” is not a problem hopefully? And also perhaps relevant is that the containing field group (which this repeater is in) is also used on normal posts.

  • I have the JSON fields file if that would be useful. Can I send it to you somehow?

  • It would have to do with the repeater field name. For example if you have a repeater field with field names like

    • repeater_fields
      • text_field_1
      • text_field_2

    and another repeater field like

    • repeater_fields
      • text_field_3
      • text_field_4

    There’s a chance that this could confuse ACF.
    Other than the reasons I’ve covered there’s no reason that this should not be working. The only thing left is some action or filter function that’s interfering with ACF operation.

  • I ran a query and spit out all of the fields I have published in my DB. You can see the output below. I could only find one field that had the same name as another field with different field types for the same name.

    In my case I have multiple options pages. So I have the standard ‘options’ page and then I have another one called ’60day’. Now I tried moving my one issue field between these two pages, but that didn’t fix the issue. Reverting back to ACF 5.3.1 did fix this issue though. A week later I was doing some performance tuning and decided to move the field groups to PHP files. With this move, even with ACF 5.3.1 I was getting the item count output for my repeater fields. So I had to move my one ’60day’ field group back to the DB.

    I have gone through the usual steps of switching to a default theme and also disabled all non-standard plugins. I think the main question is what’s different between the field getting populated in my edit pages, which does work, versus getting the field values in the theme.

    THIS FIELD HAD NO NAME FOR SOME REASON
    -tab (1)
    Thumbnail
    -image (1)
    _copy
    -tab (1)
    add_photo_gallery
    -true_false (1)
    add_title_butterfly
    -true_false (1)
    affirmation_mp3
    -file (1)
    audio_file
    -file (1)
    author_link
    -text (1)
    author_location
    -radio (1)
    auto_play_video_once_on_load
    -true_false (1)
    background_image
    -image (4)
    boxed_content
    -true_false (1)
    button_label
    -text (2)
    button_link_type
    -radio (1)
    button_link_url
    -text (1)
    category_name
    -text (1)
    challenge_mp3
    -file (1)
    column_title
    -text (1)
    content
    -wysiwyg (1)
    content_colour
    -radio (3)
    daily_email_body
    -wysiwyg (1)
    daily_email_files
    -repeater (1)
    daily_email_subject
    -text (1)
    daily_emails
    -tab (1)
    date
    -textarea (1)
    -date_picker (2)
    dates
    -repeater (1)
    days
    -repeater (1)
    deal_start_date
    -date_picker (1)
    deck
    -post_object (1)
    description
    -textarea (7)
    -wysiwyg (2)
    fancy_title
    -true_false (1)
    feature_blocks
    -repeater (1)
    feature_image
    -image (2)
    feature_logos
    -image (1)
    footer_note
    -textarea (2)
    freebies
    -repeater (1)
    gallery
    -gallery (1)
    gallery_photos
    -gallery (1)
    gallery_position
    -radio (1)
    gratitude_mp3
    -file (1)
    gravity_form_id
    -number (1)
    highlight
    -textarea (2)
    highlight_cirlces
    -repeater (1)
    highlights
    -repeater (1)
    icon
    -select (1)
    -image (1)
    icon_features
    -repeater (1)
    intro*******
    -textarea (2)
    -wysiwyg (2)
    -repeater (1)
    intro_column_text
    -wysiwyg (1)
    intro_content_footer
    -text (1)
    intro_sub-title
    -wysiwyg (2)
    intro_title
    -text (2)
    item
    -textarea (1)
    job/location
    -text (1)
    link_feature_to_page
    -url (1)
    link_url
    -url (1)
    list_items
    -repeater (1)
    listing_type
    -radio (1)
    mailchimp_newsletter_group_name
    -text (1)
    monday_email_body
    -wysiwyg (1)
    monday_email_subject
    -text (1)
    monday_emails
    -tab (1)
    more_info_page
    -page_link (1)
    name
    -text (3)
    num_registrants
    -number (3)
    num_tickets
    -text (1)
    on_sale_products_only
    -true_false (1)
    outline_photos
    -true_false (1)
    page
    -post_object (1)
    page_blocks
    -repeater (1)
    page_icon
    -image (1)
    photo
    -image (6)
    product
    -post_object (2)
    product_category
    -taxonomy (1)
    purchase_buttons
    -repeater (1)
    purchase_date
    -date_picker (2)
    quote
    -textarea (1)
    recipients
    -repeater (1)
    registration_page
    -page_link (1)
    section_title
    -text (6)
    show_add_to_cart
    -true_false (1)
    side_scroll_on_mobile
    -true_false (1)
    sold_out
    -true_false (1)
    sub-title
    -text (2)
    subscriber_user
    -user (2)
    testimonials
    -repeater (1)
    thumbnail
    -image (1)
    ticket_type
    -text (1)
    time
    -text (3)
    time_of_day_to_switch_deals
    -text (1)
    title
    -text (14)
    title_icon
    -image (1)
    user
    -user (1)
    video_thumbnail
    -image (1)
    video_title
    -text (1)
    videos
    -repeater (1)
    vimeo_id
    -text (2)
    vimeo_video_url
    -url (1)
    -text (1)
    weekly_videos
    -repeater (1)
    worksheet
    -file (1)
    youtube_video_id
    -text (2)
    youtube_video_ids
    -repeater (1)

  • @rps what does the code in your theme look like?

    something like this?

    
    if( function_exists('acf_add_local_field_group') ):
    // ... code to register field group
    

    if it does then try putting it into a action like this

    
    add_action('init', 'load_theme_acf_groups');
    function load_theme_acf_groups() {
        if( function_exists('acf_add_local_field_group') ):
        // ... code to register field group
    }
    

    I don’t know that this will solve the problem, but it can’t hurt to try

  • Okay I did a little more digging on this. I’m still seeing an issue between ACF 5.3.1 and ACF 5.3.3.2. In my theme everything works as expected. Our issue seems to be in a custom plugin where we start to get weird results. If I call get_field on a repeater I get the item count and if I call get_field on a flexible_content field I get an array of the field types, but none of the content for the groups.

    So I tried a few things to fix this:

    1. I was loading the fields via the init action, but that was in my theme, so I moved those to a custom plugin. In both 5.3.1 and 5.3.3.2 the fields fail to load if I’m loading the custom fields from the exported PHP definitions. If I move the fields back to the DB then 5.3.1 works and 5.3.3.2 fails.
    2. So the PHP field groups not loading made me think this was simply a hook priority thing so I set my field groups to a low priority number for early execution and then changed my plugin to a high priority late execution. This still gave the same odd results.
    3. Then I switch back to loading the fields from the DB. In this case 5.3.1 went back to working. 5.3.3.2 still failed so I left my plugin to late init with a priority of 999, but again that still didn’t work.

    So to confirm, my theme works perfectly with no loading issues. It’s in my plugin where the issues arise. Hopefully this helps a bit.

  • In your plugin, rather than using the init action to load your field group try using the acf/include_fields hook.

  • Hi John

    I’ve now had some time to do some digging. I can reproduce the problem with my repeater field called “fields”, which is attached both to option pages and to cdertain custom posts.

    There is some difference between the paths through my code, but I am stumped what is going on. Perhaps some initialisation is not complete in one case but is complete in the other.

    Anyhow, in one case, get_field(‘fields’, ‘option’) returns the value 8. And in the other it returns an array of sub-fields. I stuck some debugging code into ACF’s get_fields function in api_template.php. The two cases look like this:

    get_field fields
    array(23) {
      ["ID"]=>
      int(3220)
      ["key"]=>
      string(19) "field_553bf4f728d48"
      ["label"]=>
      string(6) "Fields"
      ["name"]=>
      string(6) "fields"
      ["prefix"]=>
      string(0) ""
      ["type"]=>
      string(8) "repeater"
      ["value"]=>
      NULL
      ["menu_order"]=>
      int(1)
      ["instructions"]=>
      string(0) ""
      ["required"]=>
      int(0)
      ["id"]=>
      string(0) ""
      ["class"]=>
      string(0) ""
      ["conditional_logic"]=>
      int(0)
      ["parent"]=>
      int(3690)
      ["wrapper"]=>
      array(3) {
        ["width"]=>
        string(0) ""
        ["class"]=>
        string(0) ""
        ["id"]=>
        string(0) ""
      }
      ["_name"]=>
      string(6) "fields"
      ["_input"]=>
      string(0) ""
      ["_valid"]=>
      int(1)
      ["collapsed"]=>
      string(0) ""
      ["min"]=>
      string(0) ""
      ["max"]=>
      string(0) ""
      ["layout"]=>
      string(5) "table"
      ["button_label"]=>
      string(19) "Eintrag hinzufügen"
    }
    

    and

    get_field fields
    array(24) {
      ["ID"]=>
      int(0)
      ["key"]=>
      string(19) "field_553bf4f728d48"
      ["label"]=>
      string(6) "Fields"
      ["name"]=>
      string(6) "fields"
      ["prefix"]=>
      string(0) ""
      ["type"]=>
      string(8) "repeater"
      ["value"]=>
      NULL
      ["menu_order"]=>
      int(1)
      ["instructions"]=>
      string(0) ""
      ["required"]=>
      int(0)
      ["id"]=>
      string(0) ""
      ["class"]=>
      string(0) ""
      ["conditional_logic"]=>
      int(0)
      ["parent"]=>
      string(19) "group_56ade92322eae"
      ["wrapper"]=>
      array(3) {
        ["width"]=>
        string(0) ""
        ["class"]=>
        string(0) ""
        ["id"]=>
        string(0) ""
      }
      ["_name"]=>
      string(6) "fields"
      ["_input"]=>
      string(0) ""
      ["_valid"]=>
      int(1)
      ["collapsed"]=>
      string(0) ""
      ["min"]=>
      string(0) ""
      ["max"]=>
      string(0) ""
      ["layout"]=>
      string(5) "table"
      ["button_label"]=>
      string(19) "Eintrag hinzufügen"
      ["sub_fields"]=>
      array(8) {
        [0]=>
        array(25) {
          ["ID"]=>
          int(0)
          ["key"]=>
          string(19) "field_56955dd93546a"
          ["label"]=>
          string(8) "Template"
          ["name"]=>
          string(8) "template"
          ["prefix"]=>
          string(0) ""
          ["type"]=>
          string(8) "textarea"
          ["value"]=>
          NULL
          ["menu_order"]=>
          int(0)
          ["instructions"]=>
          string(0) ""
          ["required"]=>
          int(0)
          ["id"]=>
          string(0) ""
          ["class"]=>
          string(0) ""
          ["conditional_logic"]=>
          int(0)
          ["parent"]=>
          string(19) "field_553bf4f728d48"
          ["wrapper"]=>
          array(3) {
            ["width"]=>
            int(25)
            ["class"]=>
            string(0) ""
            ["id"]=>
            string(0) ""
          }
          ["_name"]=>
          string(8) "template"
          ["_input"]=>
          string(0) ""
          ["_valid"]=>
          int(1)
          ["default_value"]=>
          string(0) ""
          ["placeholder"]=>
          string(0) ""
          ["maxlength"]=>
          string(0) ""
          ["rows"]=>
          int(4)
          ["new_lines"]=>
          string(7) "wpautop"
          ["readonly"]=>
          int(0)
          ["disabled"]=>
          int(0)
        }
        [1]=>
        array(25) {
          ["ID"]=>
          int(0)
          ["key"]=>
          string(19) "field_553bf52028d4a"
          ["label"]=>
          string(11) "Input field"
          ["name"]=>
          string(11) "input_field"
          ["prefix"]=>
          string(0) ""
          ["type"]=>
          string(4) "text"
          ["value"]=>
          NULL
          ["menu_order"]=>
          int(1)
          ["instructions"]=>
          string(0) ""
          ["required"]=>
          int(0)
          ["id"]=>
          string(0) ""
          ["class"]=>
          string(0) ""
          ["conditional_logic"]=>
          array(1) {
            [0]=>
            array(1) {
              [0]=>
              array(3) {
                ["field"]=>
                string(19) "field_55435282b6fb1"
                ["operator"]=>
                string(2) "!="
                ["value"]=>
                string(8) "template"
              }
            }
          }
          ["parent"]=>
          string(19) "field_553bf4f728d48"
          ["wrapper"]=>
          array(3) {
            ["width"]=>
            int(10)
            ["class"]=>
            string(0) ""
            ["id"]=>
            string(0) ""
          }
          ["_name"]=>
          string(11) "input_field"
          ["_input"]=>
          string(0) ""
          ["_valid"]=>
          int(1)
          ["default_value"]=>
          string(0) ""
          ["placeholder"]=>
          string(0) ""
          ["prepend"]=>
          string(0) ""
          ["append"]=>
          string(0) ""
          ["maxlength"]=>
          string(0) ""
          ["readonly"]=>
          int(0)
          ["disabled"]=>
          int(0)
        }
        [2]=>
        array(25) {
          ["ID"]=>
          int(0)
          ["key"]=>
          string(19) "field_55425787757b6"
          ["label"]=>
          string(8) "Mappings"
          ["name"]=>
          string(8) "mappings"
          ["prefix"]=>
          string(0) ""
          ["type"]=>
          string(8) "textarea"
          ["value"]=>
          NULL
          ["menu_order"]=>
          int(2)
          ["instructions"]=>
          string(0) ""
          ["required"]=>
          int(0)
          ["id"]=>
          string(0) ""
          ["class"]=>
          string(0) ""
          ["conditional_logic"]=>
          int(0)
          ["parent"]=>
          string(19) "field_553bf4f728d48"
          ["wrapper"]=>
          array(3) {
            ["width"]=>
            int(15)
            ["class"]=>
            string(0) ""
            ["id"]=>
            string(0) ""
          }
          ["_name"]=>
          string(8) "mappings"
          ["_input"]=>
          string(0) ""
          ["_valid"]=>
          int(1)
          ["default_value"]=>
          string(0) ""
          ["placeholder"]=>
          string(0) ""
          ["maxlength"]=>
          string(0) ""
          ["rows"]=>
          int(4)
          ["new_lines"]=>
          string(7) "wpautop"
          ["readonly"]=>
          int(0)
          ["disabled"]=>
          int(0)
        }
        [3]=>
        array(27) {
          ["ID"]=>
          int(0)
          ["key"]=>
          string(19) "field_553bf53b50eb8"
          ["label"]=>
          string(8) "Function"
          ["name"]=>
          string(8) "function"
          ["prefix"]=>
          string(0) ""
          ["type"]=>
          string(6) "select"
          ["value"]=>
          NULL
          ["menu_order"]=>
          int(3)
          ["instructions"]=>
          string(0) ""
          ["required"]=>
          int(1)
          ["id"]=>
          string(0) ""
          ["class"]=>
          string(0) ""
          ["conditional_logic"]=>
          array(1) {
            [0]=>
            array(1) {
              [0]=>
              array(3) {
                ["field"]=>
                string(19) "field_55435282b6fb1"
                ["operator"]=>
                string(2) "!="
                ["value"]=>
                string(8) "template"
              }
            }
          }
          ["parent"]=>
          string(19) "field_553bf4f728d48"
          ["wrapper"]=>
          array(3) {
            ["width"]=>
            int(10)
            ["class"]=>
            string(0) ""
            ["id"]=>
            string(0) ""
          }
          ["_name"]=>
          string(8) "function"
          ["_input"]=>
          string(0) ""
          ["_valid"]=>
          int(1)
          ["choices"]=>
          array(34) {
            ["(just copy)"]=>
            string(11) "(just copy)"
            ["build subtitle"]=>
            string(14) "build subtitle"
            ["build subtitle*"]=>
            string(15) "build subtitle*"
            ["clean up text"]=>
            string(13) "clean up text"
            ["contributors list"]=>
            string(17) "contributors list"
            ["contributors list*"]=>
            string(18) "contributors list*"
            ["convert terms to names"]=>
            string(22) "convert terms to names"
            ["create route"]=>
            string(12) "create route"
            ["get term ID list"]=>
            string(16) "get term ID list"
            ["get term name list"]=>
            string(18) "get term name list"
            ["handle categories"]=>
            string(17) "handle categories"
            ["handle categories*"]=>
            string(18) "handle categories*"
            ["handle gallery"]=>
            string(14) "handle gallery"
            ["handle image"]=>
            string(12) "handle image"
            ["handle media image"]=>
            string(18) "handle media image"
            ["meta data"]=>
            string(9) "meta data"
            ["process contributors"]=>
            string(20) "process contributors"
            ["process contributors*"]=>
            string(21) "process contributors*"
            ["process date/time"]=>
            string(17) "process date/time"
            ["process date/time*"]=>
            string(18) "process date/time*"
            ["process excerpt"]=>
            string(15) "process excerpt"
            ["process excerpt*"]=>
            string(16) "process excerpt*"
            ["process homepage feed"]=>
            string(21) "process homepage feed"
            ["process homepage feed*"]=>
            string(22) "process homepage feed*"
            ["process links"]=>
            string(13) "process links"
            ["process links*"]=>
            string(14) "process links*"
            ["process location"]=>
            string(16) "process location"
            ["process location*"]=>
            string(17) "process location*"
            ["process menu"]=>
            string(12) "process menu"
            ["process menu*"]=>
            string(13) "process menu*"
            ["process permalink"]=>
            string(17) "process permalink"
            ["process permalink*"]=>
            string(18) "process permalink*"
            ["process redirections"]=>
            string(20) "process redirections"
            ["process redirections*"]=>
            string(21) "process redirections*"
          }
          ["default_value"]=>
          array(1) {
            ["(just copy)"]=>
            string(11) "(just copy)"
          }
          ["allow_null"]=>
          int(0)
          ["multiple"]=>
          int(0)
          ["ui"]=>
          int(0)
          ["ajax"]=>
          int(0)
          ["placeholder"]=>
          string(0) ""
          ["disabled"]=>
          int(0)
          ["readonly"]=>
          int(0)
        }
        [4]=>
        array(25) {
          ["ID"]=>
          int(0)
          ["key"]=>
          string(19) "field_553bf4cf28d47"
          ["label"]=>
          string(12) "Output field"
          ["name"]=>
          string(12) "output_field"
          ["prefix"]=>
          string(0) ""
          ["type"]=>
          string(4) "text"
          ["value"]=>
          NULL
          ["menu_order"]=>
          int(4)
          ["instructions"]=>
          string(0) ""
          ["required"]=>
          int(1)
          ["id"]=>
          string(0) ""
          ["class"]=>
          string(0) ""
          ["conditional_logic"]=>
          int(0)
          ["parent"]=>
          string(19) "field_553bf4f728d48"
          ["wrapper"]=>
          array(3) {
            ["width"]=>
            int(10)
            ["class"]=>
            string(0) ""
            ["id"]=>
            string(0) ""
          }
          ["_name"]=>
          string(12) "output_field"
          ["_input"]=>
          string(0) ""
          ["_valid"]=>
          int(1)
          ["default_value"]=>
          string(0) ""
          ["placeholder"]=>
          string(0) ""
          ["prepend"]=>
          string(0) ""
          ["append"]=>
          string(0) ""
          ["maxlength"]=>
          string(0) ""
          ["readonly"]=>
          int(0)
          ["disabled"]=>
          int(0)
        }
        [5]=>
        array(22) {
          ["ID"]=>
          int(0)
          ["key"]=>
          string(19) "field_567952d8e077e"
          ["label"]=>
          string(12) "Local output"
          ["name"]=>
          string(12) "local_output"
          ["prefix"]=>
          string(0) ""
          ["type"]=>
          string(8) "checkbox"
          ["value"]=>
          NULL
          ["menu_order"]=>
          int(5)
          ["instructions"]=>
          string(0) ""
          ["required"]=>
          int(0)
          ["id"]=>
          string(0) ""
          ["class"]=>
          string(0) ""
          ["conditional_logic"]=>
          array(1) {
            [0]=>
            array(1) {
              [0]=>
              array(3) {
                ["field"]=>
                string(19) "field_55435282b6fb1"
                ["operator"]=>
                string(2) "!="
                ["value"]=>
                string(8) "template"
              }
            }
          }
          ["parent"]=>
          string(19) "field_553bf4f728d48"
          ["wrapper"]=>
          array(3) {
            ["width"]=>
            int(10)
            ["class"]=>
            string(0) ""
            ["id"]=>
            string(0) ""
          }
          ["_name"]=>
          string(12) "local_output"
          ["_input"]=>
          string(0) ""
          ["_valid"]=>
          int(1)
          ["choices"]=>
          array(4) {
            ["blob"]=>
            string(4) "blob"
            ["feed"]=>
            string(4) "feed"
            ["tsv"]=>
            string(3) "tsv"
            ["hidden"]=>
            string(6) "hidden"
          }
          ["default_value"]=>
          array(1) {
            ["blob"]=>
            string(4) "blob"
          }
          ["layout"]=>
          string(8) "vertical"
          ["toggle"]=>
          int(0)
        }
        [6]=>
        array(22) {
          ["ID"]=>
          int(0)
          ["key"]=>
          string(19) "field_56795385c1e73"
          ["label"]=>
          string(13) "Export output"
          ["name"]=>
          string(13) "export_output"
          ["prefix"]=>
          string(0) ""
          ["type"]=>
          string(8) "checkbox"
          ["value"]=>
          NULL
          ["menu_order"]=>
          int(6)
          ["instructions"]=>
          string(0) ""
          ["required"]=>
          int(0)
          ["id"]=>
          string(0) ""
          ["class"]=>
          string(0) ""
          ["conditional_logic"]=>
          array(1) {
            [0]=>
            array(1) {
              [0]=>
              array(3) {
                ["field"]=>
                string(19) "field_55435282b6fb1"
                ["operator"]=>
                string(2) "!="
                ["value"]=>
                string(8) "template"
              }
            }
          }
          ["parent"]=>
          string(19) "field_553bf4f728d48"
          ["wrapper"]=>
          array(3) {
            ["width"]=>
            int(10)
            ["class"]=>
            string(0) ""
            ["id"]=>
            string(0) ""
          }
          ["_name"]=>
          string(13) "export_output"
          ["_input"]=>
          string(0) ""
          ["_valid"]=>
          int(1)
          ["choices"]=>
          array(3) {
            ["blob"]=>
            string(4) "blob"
            ["feed"]=>
            string(4) "feed"
            ["tsv"]=>
            string(3) "tsv"
          }
          ["default_value"]=>
          array(0) {
          }
          ["layout"]=>
          string(8) "vertical"
          ["toggle"]=>
          int(0)
        }
        [7]=>
        array(23) {
          ["ID"]=>
          int(0)
          ["key"]=>
          string(19) "field_55435282b6fb1"
          ["label"]=>
          string(8) "Back End"
          ["name"]=>
          string(8) "back_end"
          ["prefix"]=>
          string(0) ""
          ["type"]=>
          string(5) "radio"
          ["value"]=>
          NULL
          ["menu_order"]=>
          int(7)
          ["instructions"]=>
          string(0) ""
          ["required"]=>
          int(1)
          ["id"]=>
          string(0) ""
          ["class"]=>
          string(0) ""
          ["conditional_logic"]=>
          int(0)
          ["parent"]=>
          string(19) "field_553bf4f728d48"
          ["wrapper"]=>
          array(3) {
            ["width"]=>
            int(10)
            ["class"]=>
            string(0) ""
            ["id"]=>
            string(0) ""
          }
          ["_name"]=>
          string(8) "back_end"
          ["_input"]=>
          string(0) ""
          ["_valid"]=>
          int(1)
          ["choices"]=>
          array(4) {
            ["no display"]=>
            string(10) "no display"
            ["date/status"]=>
            string(11) "date/status"
            ["info"]=>
            string(4) "info"
            ["template"]=>
            string(8) "template"
          }
          ["other_choice"]=>
          int(0)
          ["save_other_choice"]=>
          int(0)
          ["default_value"]=>
          string(10) "no display"
          ["layout"]=>
          string(8) "vertical"
        }
      }
    }
    

    Please give me a hint what I need to look for in my code. Or maybe I can call something to force ACF to initialise fully?

    Thanks

    David

  • …and…

    In the first (broken) case, the “parent” has the value 3690.

    If I enter …/wp-admin/post.php?post=3690&action=edit within WordPress, it shows me the edit screen for the field group.

  • I honestly can’t say by looking at the arrays that are returned what is causing this. I’ve up a similar situation on a test site and it’s still working correctly for me. I’m stumped.

  • Hi John

    Without giving away too much, can you give me a hint what WordPress context must have been set up for the repeater field to initialise correctly? Failing that, please tell me which ACF routine is called and I’ll debug it. I’m sure there is something subtle in the ordering of calls, but as I have little or no know-how of the internals of ACF, it is hard for me to work out what might be the issue.

    BTW, this is not the first time that a problem like this has been found with repeaters: what was the solution last time?

    Thanks, David

Viewing 25 posts - 1 through 25 (of 34 total)

The topic ‘ACF Pro – Options pages with Repeaters not working’ is closed to new replies.