Display a Post Status selector as radio, checkbox or select field type.
Setting name | Description |
Allow post statuses | Filter which post status can be chosen |
Appearance | Select the appearance of this field |
Return Value | Return the post status 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_statuses = get_field('post_statuses');
/**
* array(
* 'label' => 'Published',
* 'label_count' => array(
* 'Published <span class="count">(%s)</span>',
* 'Published <span class="count">(%s)</span>',
* 'singular' => 'Published <span class="count">(%s)</span>',
* 'plural' => 'Published <span class="count">(%s)</span>',
* 'context' => null,
* 'domain' => null,
* ),
* 'exclude_from_search' => false,
* '_builtin' => true,
* 'public' => true,
* 'internal' => false,
* 'protected' => false,
* 'private' => false,
* 'publicly_queryable' => true,
* 'show_in_admin_status_list' => true,
* 'show_in_admin_all_list' => true,
* 'date_floating' => false,
* 'name' => 'publish',
* )
*/
$post_statuses = get_field('post_statuses');
// publish
$post_statuses = get_field('post_statuses', false, false);
// publish