Control: Radio - 10quality/wpmvc-addon-metaboxer GitHub Wiki
Control used as a field type to display an HTML <input[type="radio"]>
.
Usage
class Post extends Model
{
// Class properties and methods...
protected function init()
{
$this->metaboxes = [
'metabox_id' => [
'tabs' => [
'tab_id' => [
'fields' => [
'my_radio' => [
'type' => 'radio',
'title' => __( 'My radio field', 'my-domain' ),
'options' => [
'a' => __( 'Option A', 'my-domain' ),
'b' => __( 'Option B', 'my-domain' ),
'c' => __( 'Option C', 'my-domain' ),
],
],
'left_right' => [
'type' => 'input',
'title' => __( 'Left or right', 'my-domain' ),
'default' => 'left',
'description' => __( 'Radio control (radio group example).' ),
'options' => [
'left' => 'Left',
'right' => 'Right',
],
'control' => [
'direction' => 'column',
],
],
// Other fields...
],
],
],
],
];
}
}
Control options
Control | Data type | Description |
---|---|---|
direction |
string |
Horizontal row (default). vertical column . |