Hello,
I have a setup that’s rather unique as far as using ACF goes, and I think I’m trying to do something that’s either not allowed, or I’m simply doing things incorrectly.
The situation: I have a form on my client’s site that contains a <select> called #campus. When an <option> is selected from #campus, a second (conditional) <select> called #program appears, and contains a list of <option>s that is unique to the selected #campus <option>.
Because of certain constraints (I’m picking this site up from a previous developer), I built out a jQuery function that uses .load() to load a .php file into #program that contains the appropriate <option>s based on whatever #campus <option> the user selects. Up to this point, everything has been working properly.
Here’s where it started to break: In an attempt to be able to add/remove/edit the #program <option>s from the WP backend, I created an ACF Repeater and added it to one of the .php files that contains a set of #program <option>s. The code looks like this:
<?php
if( have_rows('programs', 'option') ):
while ( have_rows('programs', 'option') ) : the_row(); ?>
<option value="<?php the_sub_field('program_value', 'option'); ?>"><?php
the_sub_field('program_copy', 'option'); ?></option>
<?php endwhile;
endif;?>
So, basically, I’m trying to use jQuery to .load() in a .php file that contains ACF Repeater code and it’s returning the following error: Uncaught Error: Call to undefined function have_rows()
Any help? I hope I was able to explain everything clearly.