Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
- // Flex and flex-item type.
- $meta_boxes[] = array(
- 'title' => 'Meta box flex simple',
- 'fields' => array(
- array(
- 'type' => 'flex', // This will define a flex container.
- 'flex' => array(), // Flex attributes.
- 'fields' => array(
- array(
- 'type' => 'flex-item',
- 'flex' => array(), // Flex attributes.
- 'fields' => array(
- array(
- 'type' => 'text',
- 'id' => 'field-a',
- 'title' => 'Field A',
- ),
- array(
- 'type' => 'text',
- 'id' => 'field-b',
- 'title' => 'Field B',
- ),
- ),
- ),
- array(
- 'type' => 'flex-item',
- 'flex' => array(), // Flex attributes.
- 'fields' => array(
- array(
- 'type' => 'text',
- 'id' => 'field-c',
- 'title' => 'Field C',
- ),
- ),
- ),
- ),
- ),
- ),
- );
- $meta_boxes[] = array(
- 'title' => 'Meta box flex in a group',
- 'fields' => array(
- array(
- 'type' => 'group',
- 'fields' => array(
- array(
- 'type' => 'flex', // This will define a flex container.
- 'flex' => array(), // Flex attributes.
- 'fields' => array(
- array(
- 'type' => 'flex-item',
- 'flex' => array(), // Flex attributes.
- 'fields' => array(
- array(
- 'type' => 'text',
- 'id' => 'field-a',
- 'title' => 'Field A',
- ),
- array(
- 'type' => 'text',
- 'id' => 'field-b',
- 'title' => 'Field B',
- ),
- ),
- ),
- array(
- 'type' => 'flex-item',
- 'flex' => array(), // Flex attributes.
- 'fields' => array(
- array(
- 'type' => 'text',
- 'id' => 'field-c',
- 'title' => 'Field C',
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- );
- return $meta_boxes;
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement