-
Notifications
You must be signed in to change notification settings - Fork 0
Home
MD Sultan Nasir Uddin edited this page Jun 20, 2018
·
2 revisions
Welcome to the metabox wiki! Download the repo and put inside your plugin or theme directory.
require dirname(__FILE__) . '/metabox/class-metabox.php'
add_action( 'admin_init', 'add_custom_metabox' );
function(add_custom_metabox){
$metabox = new \Pluginever\Framework\Metabox( 'html-id' );
$config = array(
'title' => __( 'Metabox Settings', 'wpcp' ),
'screen' => 'post',
'context' => 'normal',
'priority' => 'high',
'lazy_loading' => 'true',
'class' => 'custom-class',
'fields' => [
[
'type' => 'text',
'label' => __( 'Example Field', 'wpcp' ),
'name' => 'example_field',
'sanitize' => 'esc_html',
],
],
);
$metabox->init( $config );
}