Home › Forums › General Issues › Dynamically registered (via PHP) relationship fields return no results › Reply To: Dynamically registered (via PHP) relationship fields return no results
Aaand 10 months later I stumbled on this bug again.
I’m registering fields dynamically:
foreach( $levels as $i => $level ) {
$name = "level_{$level->term_id}_winner";
acf_add_local_field([
'parent' => 'group_5cb57c19cffde',
'key' => "field_{$name}",
'label' => sprintf( __( '%s level winner', 'imatch' ), $level->name ),
'name' => $name,
'type' => 'post_object',
'post_type' => [ 'im_registration' ],
'taxonomy' => [],
'allow_null' => true,
'return_format' => 'id',
]);
}
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.