Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
- function your_prefix_register_meta_boxes( $meta_boxes ) {
- $prefix = '';
- $meta_boxes[] = array (
- 'title' => esc_html__( 'Group', 'text-domain' ),
- 'id' => 'group',
- 'post_types' => array(
- 0 => 'post',
- ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- array (
- 'id' => $prefix . 'group',
- 'type' => 'group',
- 'name' => esc_html__( 'Group', 'text-domain' ),
- 'fields' => array(
- array (
- 'id' => $prefix . 'radio',
- 'name' => esc_html__( 'Radio', 'text-domain' ),
- 'type' => 'radio',
- 'std' => 'home',
- 'options' => array(
- 'organisation_this' => esc_html__( 'This organisation', 'text-domain' ),
- 'organisation_other' => esc_html__( 'Other organisation', 'text-domain' ),
- 'home' => esc_html__( 'Home address', 'text-domain' ),
- ),
- 'clone' => 1,
- 'clone_default' => 1,
- ),
- array (
- 'id' => $prefix . 'text',
- 'type' => 'text',
- 'name' => esc_html__( 'Text Field', 'text-domain' ),
- 'std' => 'Default text',
- 'clone_default' => 1,
- ),
- array (
- 'id' => $prefix . 'checkbox',
- 'name' => esc_html__( 'Checkbox', 'text-domain' ),
- 'type' => 'checkbox',
- 'desc' => esc_html__( 'Default Description', 'text-domain' ),
- 'std' => 1,
- ),
- array (
- 'id' => $prefix . 'checkbox',
- 'name' => esc_html__( 'Checkbox List', 'text-domain' ),
- 'type' => 'checkbox_list',
- 'std' => 3,
- 'options' => array(
- 1 => esc_html__( '1', 'text-domain' ),
- 2 => esc_html__( '2', 'text-domain' ),
- 3 => esc_html__( '3', 'text-domain' ),
- ),
- 'clone' => 1,
- 'inline' => 1,
- 'clone_default' => 1,
- ),
- array (
- 'id' => $prefix . 'select',
- 'name' => esc_html__( 'Select Field', 'text-domain' ),
- 'type' => 'select',
- 'std' => 2,
- 'placeholder' => esc_html__( 'Select an Item', 'text-domain' ),
- 'options' => array(
- 1 => esc_html__( '1', 'text-domain' ),
- 2 => esc_html__( '2', 'text-domain' ),
- 3 => esc_html__( '3', 'text-domain' ),
- 4 => esc_html__( '4', 'text-domain' ),
- ),
- 'clone' => 1,
- 'clone_default' => 1,
- ),
- array (
- 'id' => $prefix . 'select_advanced',
- 'name' => esc_html__( 'Select Advanced', 'text-domain' ),
- 'type' => 'select_advanced',
- 'std' => 'c',
- 'placeholder' => esc_html__( 'Select an Item', 'text-domain' ),
- 'options' => array(
- 'a' => esc_html__( 'A', 'text-domain' ),
- 'b' => esc_html__( 'B', 'text-domain' ),
- 'c' => esc_html__( 'C', 'text-domain' ),
- 'd' => esc_html__( 'D', 'text-domain' ),
- ),
- 'clone' => 1,
- 'clone_default' => 1,
- ),
- ),
- 'clone' => 1,
- 'default_state' => 'expanded',
- 'clone_default' => 1,
- 'collapsible' => true,
- ),
- ),
- );
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement