-
Notifications
You must be signed in to change notification settings - Fork 63
Fields
Fields are very easy to add to a field group. There is very general addField($name, $args = []) method that will accept a name (to be in lowercase and underscores) and an array of field configurations that can be found on the ACF register fields via PHP page. If you don't specify a type option, ACF will default to a normal text field.
Luckily the ACF Builder library provides a number of self descriptive shortcut functions for adding different field types. The best way to see all the available field type functions in the FieldsBuilder.php class file, and their options correlate to those defined by ACF
If you're using a 3rd party ACF plugin that adds additional field types, you can just use the generic addField function and pass the field type to the $args array.
Want to contribute to this Wiki? Fork it and send a pull request.
© Stout Logic, LLC