# Metabox

# Class

use Be\Minotaure\Widgets\Core\M_Metabox;
1

# Create a new group of fields (metabox)

$metabox = new M_Metabox();
$metabox->set('m_my_metabox', 'post_type')
        ->setTitle('Metabox Title')
        ->add(
            [
                'type' => 'date',
                'title' => __('Field Title', M_TD),
                'name' => 'm_field_slug',
            ]
        );
1
2
3
4
5
6
7
8
9
10

# Avalaible fields type

# Text

[
    'type' => 'text',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
]
1
2
3
4
5

# Time

[
    'type' => 'time',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
]
1
2
3
4
5

# Date

[
    'type' => 'date',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
]
1
2
3
4
5

# Select

[
    'type' => 'time',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
    'choices' => [
        'id_1' => 'Title 1',
        'id_2' => 'Title 2',
        'id_3' => 'Title 3',
        'id_4' => 'Title 4',
    ],
]
1
2
3
4
5
6
7
8
9
10
11

# Checkbox

[
    'type' => 'checkbox',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
]
1
2
3
4
5

# Radio

[
    'type' => 'radio',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
]
1
2
3
4
5

# Media

[
    'type' => 'media',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
]
1
2
3
4
5

# File

[
    'type' => 'file',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
]
1
2
3
4
5

# Editor

[
    'type' => 'editor',
    'title' => __('Field Title', M_TD),
    'name' => 'm_field_slug',
]
1
2
3
4
5
Last Updated: 5/25/2020, 10:46:21 AM