Display a Post Type selector as radio, checkbox or select field type.
Setting name | Description |
Allow post types | Filter which post types can be chosen |
Appearance | Select the appearance of this field |
Return Value | Return the post types name or object |
Allow Null | Allow empty value |
Layout | Choose the layout |
Toggle | Allow to toggle all values |
Allow Custom | Allow custom value |
Select multiple values | Allow multiple values selection |
Stylised UI | Enable Select2 UI style |
$post_types = get_field('post_types');
/**
* array(
* 'name' => 'page',
* 'label' => 'Pages',
* 'description' => '',
* 'public' => true,
* 'hierarchical' => true,
* 'exclude_from_search' => false,
* 'publicly_queryable' => false,
* ...
* )
*/
$post_types = get_field('post_types');
// page
$post_types = get_field('post_types', false, false);
// page