Support

Account

Home Forums Add-ons Repeater Field get_field occassionally returning string with repeater field Reply To: get_field occassionally returning string with repeater field

  • First I am going to repeat my comment from your other topic the if statements here are not effective and the code inside of them will run whether or not get_field() returns any results.

    Second issue is that you are now taking about repeaters that are completely different than a gallery field.

    When you use get_field(‘repeater’) and you get a string back, the issue is that ACF is returning the actual value of the repeater from the database and this value is the number of rows contained in the repeater. When this happens it is due to a conflict with some other code on the site and this is usually cause by a “pre_get_post” filter that is interfering with ACF getting values. Since this is an options page it could also be any filter in WP getting options.

    The first thing that you need to do is figure out where this conflict is. You need to test by deactivating other plugins and possibly switching themes to narrow down the cause. Once the cause is narrowed to the theme or a specific plugin it will be easier to figure out.