Field Render

Display an ACF Block Types selector as radio, checkbox or select field type.

Field Group

Field Settings

Setting nameDescription
Allow Block TypesFilter which block types can be chosen
AppearanceSelect the appearance of this field
Default ValueEnter each default value on a new line
Return ValueReturn the block type name or block type object
Allow NullAllow empty value
LayoutChoose the layout
ToggleAllow to toggle all values
Allow Custom
Allow custom value
Save Custom
Save custom value in the field settings
Select multiple valuesAllow multiple values selection
Stylised UIEnable Select2 UI style

Field Value

Return Format: Name

$block_types = get_field('block_types');

// my-block-type

Return Format: Object

$block_types = get_field('block_types');

/**
 * array(
 *     'name'        => 'acf/my-block-type',
 *     'title'       => 'My Block Type',
 *     'description' => '',
 *     'category'    => 'layout',
 *     'icon'        => '',
 *     'mode'        => 'preview',
 *     ...
 * )
 */

Unformatted Value

$block_types = get_field('block_types', false, false);

// my-block-type