Field Render

Display a Post Type selector as radio, checkbox or select field type.

Field Group

Field Settings

Setting nameDescription
Allow post typesFilter which post types can be chosen
AppearanceSelect the appearance of this field
Return ValueReturn the post types name or object
Allow NullAllow empty value
LayoutChoose the layout
ToggleAllow to toggle all values
Allow CustomAllow custom value
Select multiple valuesAllow multiple values selection
Stylised UIEnable Select2 UI style

Field Value

Return Format: Post Type Object

$post_types = get_field('post_types');

 * array(
 *     'name'                => 'page',
 *     'label'               => 'Pages',
 *     'description'         => '',
 *     'public'              => true,
 *     'hierarchical'        => true,
 *     'exclude_from_search' => false,
 *     'publicly_queryable'  => false,
 *     ...
 * )

Return Format: Post Type Name

$post_types = get_field('post_types');

// page

Unformatted Value

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

// page