Description
The add_field() function adds a field to a block defined with the add_block() function.
To avoid conflicts with other plugins , the add_field() function is namespaced. In order to use it, you must include the namespace with use.
use function Genesis\CustomBlocks\add_field;
add_field( $block_name, $field_name, $field_config )
Parameters
$block_name(string)$field_name(string)$field_config(array)- label
- control
- order
- settings
Usage
use function Genesis\CustomBlocks\add_block;
use function Genesis\CustomBlocks\add_field;
// The block must be defined
add_block( 'two-fish', array( 'icon' => 'waves' ) );
// Then fields can be added
add_field( 'two-fish', 'hello-there-ned-how-do-you-do' );
add_field( 'two-fish', 'tell-me-tell-me-what-is-new', array( 'placeholder' => 'My hat is old, my teeth are gold.' ) );
