1. Go to this page and download the library: Download moogatw/wp-metabox library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
moogatw / wp-metabox example snippets
use MGD\Metabox;
$options = array( ... );
$books = new Metabox( $options );
// Require the Composer autoloader.
ox;
## Usage
To create a metabox, first instantiate an instance of `Metabox`. The class takes one argument, which is an associative array. The keys to the array are similar to the arguments provided to the [add_meta_box](https://developer.wordpress.org/reference/functions/add_meta_box/) WordPress function; however, you don't provide `callback` or `callback_args`.
$metabox->addText(array(
'id' => 'metabox_text_field',
'label' => 'Text',
'desc' => 'An example description paragraph that appears below the label.'
));
$metabox->addTextArea(array(
'id' => 'metabox_textarea_field',
'label' => 'Textarea',
'desc' => 'An example description paragraph that appears below the label.'
));
$metabox->addCheckbox(array(
'id' => 'metabox_checkbox_field',
'label' => 'Checkbox',
'desc' => 'An example description paragraph that appears below the label.'
));