Thank you so much. This worked!
Thank you for your time and patience. I’ll try to make it more clear.
I have a repeater field in a field group. One of the subfields in that repeater group is a Select field type. I can’t get it to dynamically populate.
How should I change my function coding to get it to recognize a subfield Select? Or is this possible?
I’m sorry too, for not being clearer.
I put a select sub-field in a repeater field. And I need to know how to write the function for it, in that it’s loading now into a sub-field.
This is how I did it before when select was a field.
//Dynamically populate a select field’s choices in ACF
function my_acf_load_field( $field )
{
// reset choices
$field[‘choices’] = array();
// load repeater from the options page
if(get_field(‘group_a_floor_plan’, ‘option’))
{
// loop through the repeater and use the sub fields “value” and “label”
while(has_sub_field(‘group_a_floor_plan’, ‘option’))
{
$value = get_sub_field(‘value’);
$label = get_sub_field(‘label’);
$field[‘choices’][ $value ] = $label;
}
}
// Important: return the field
return $field;
}
add_filter(‘acf/load_field/name=floor_plans_group_a’, ‘my_acf_load_field’);
Does anything change?
Kept digging and was able to solve my problem as follows:
<?php if ($field = get_field(‘floor_plan’) == “ashridge-1494”)
{ $myNumber = 108700; echo($myNumber);} ?>
I’ve increased the value for the max_input_vars to 8000, and the problem is still not resolved. Can you give me any other direction to take?
I also tried setting the following because my server is using the Suhosin patch, but it did not fix the problem.
suhosin.post.max_vars = 20000
suhosin.request.max_vars = 20000
I’m having a similar situation with repeater fields. There’s a limit to how many repeater fields in a row I can use before they stop saving. I used a custom php.ini in the site root to do the following:
> php_value max_input_nesting_level 128
> php_value max_input_time 300
> php_value max_input_vars 3000
> php_value max_execution_time 300
> php_value post_max_size 32M
But this did not fix the problem. I’m going to try to boost the max_input_vars to higher.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.