Home › Forums › Backend Issues (wp-admin) › Options select in Edit Posts › Reply To: Options select in Edit Posts
Thanks for your reply but I’m not understanding all the variable connections. I’ve created a new field group called “Post Fields” with a select field called “disclosure_select” that’s assigned to show on post type “post”. It does, it’s empty. I have my options group called “Post Disclosures” with a repeater field called disclosure_picker. And in my functions.php I have”
// ACF load disclosure fields
function acf_load_disclosures( $field ) {
// reset choices
$field[‘choices’] = array();
// if has rows
if( have_rows(‘disclosure_picker’, ‘option’) ) {
// while has rows
while( have_rows(‘disclosure_picker’, ‘option’) ) {
// instantiate row
the_row();
// vars
$value = get_sub_field(‘value’);
$label = get_sub_field(‘label’);
// append to choices
$field[‘choices’][ $value ] = $label;
}
}
// return the field
return $field;
}
add_filter(‘acf/load_field/name=disclosure_select’, ‘acf_load_disclosures’);
I’m sorry if it seems I’m doing something obviously stupid here.
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.