block_lab_add_field()

Description

The block_lab_add_field() function adds a field to a block defined with the block_lab_add_block() function.

block_lab_add_field( $block_name, $field_name, $field_config ) 

Parameters

  • $block_name (string)
  • $field_name (string)
  • $field_config (array)
    • label
    • control
    • order
    • settings

Usage

// The block must be defined
block_lab_add_block( 'two-fish', array( 'icon' => 'waves' ) ); 
// Then fields can be added
block_lab_add_field( 'two-fish', 'hello-there-ned-how-do-you-do' );
block_lab_add_field( 'two-fish', 'tell-me-tell-me-what-is-new', array( 'placeholder' => 'My hat is old, my teeth are gold.' ) );