You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a repeater priority_ads and I want the collapsed value to be the ad_title subfield's key. I'm having trouble determining the field's key. The field is added to the repeater using addFields().
Hey @joseph-farruggio I agree the docs probably aren't clear on this, but I tried your example using ad_title as the collapsed key and it worked for me. But maybe in your more complicated example there is another issue?
/** * Subfield template */$ad_set = newFieldsBuilder('ad_set');
$ad_set
->addTab('ad_content')
->addText('ad_title', ['wrapper' => ['width' => '50%']]);
/** * Field group with repeater */$wp_custom_ads = newFieldsBuilder('wp_custom_ads');
$wp_custom_ads
->addRepeater(
'priority_ads',
['layout' => 'block', 'button_label' => 'New Ad', 'collapsed' => 'ad_title']
)
->addFields($ad_set)
->setLocation('options_page', '==', 'wp-custom-ads');
add_action('acf/init', function () use ($wp_custom_ads) {
acf_add_local_field_group($wp_custom_ads->build());
});
I have a repeater
priority_ads
and I want the collapsed value to be thead_title
subfield's key. I'm having trouble determining the field's key. The field is added to the repeater using addFields().I've tried multiple variations of field keys using these docs:
https://github.com/StoutLogic/acf-builder/wiki/generated-keys
https://github.com/StoutLogic/acf-builder/wiki/composing-fields#generated-keys
I get an error each time that the field (based on the key I provided) does not exist.
I've created a simplified version of my implementation:
The text was updated successfully, but these errors were encountered: