block_field_config()

Description

The block_field_config() function is a helper function for returning the field’s settings.

block_field_config( $name );

Note: If the supplied $name doesn’t exist, block_field_config() will return null.

Parameters

  • $name (string) (Required) The field name

Usage

In this example, working with a Select field, list all available options set for that field.

$select = block_field_config( 'select' );
 if ( isset( $select['settings'] ) ) {
     echo '<ul>';
     foreach( $select['settings'] as $setting ) {
         echo '<li>' . $setting . '</li>';
     }
     echo '</ul>';
 }