-
Notifications
You must be signed in to change notification settings - Fork 63
Conditions
Steve Pfisterer edited this page May 13, 2016
·
6 revisions
ACF allows fields to be visible or hidden based on the values of other fields. These conditions work exactly like the field group locations work, being comprised by and / or logic, where or takes precedence to and.
use StoutLogic\AcfBuilder\FieldsBuilder;
$builder = new FieldsBuilder('fields');
$builder
->addRadio('color')
->addChoices('red', 'blue', 'green', 'other')
->addText('other_value')
->conditional('color', '==', 'other');The above will show a text box if 'other' is selected from color, otherwise it will not be displayed in the admin.
Want to contribute to this Wiki? Fork it and send a pull request.
© Stout Logic, LLC