Home › Forums › Add-ons › Repeater Field › Populate Choices in Repeater › Reply To: Populate Choices in Repeater
I tried your code but I get a fatal error, GetPostTypes()
is not a function. What does this function do.
I tried the following and it seems to be working as expected, the field key is for a select field in a repeater that I set up in some test fields.
function page_for_post_type($field) {
if(is_admin()) {
$field['choices'] = array('choice 1','choice 2','choice 3');
}
return $field;
}
add_filter('acf/load_field/key=field_55edb28fac7a3', 'page_for_post_type');
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.