Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
- $meta_boxes[] = [
- 'title' => 'Test Meta Box',
- 'fields' => [
- [
- 'type' => 'select_advanced',
- 'id' => 's',
- 'name' => 'Select a month',
- 'options' => [
- 'jan' => 'January',
- 'feb' => 'February',
- ],
- ],
- [
- 'type' => 'group',
- 'id' => 'g_jan',
- 'name' => 'January Options',
- 'visible' => ['s', 'jan'],
- 'fields' => [
- [
- 'id' => 'l_jan',
- 'name' => 'Location',
- ],
- ],
- ],
- [
- 'type' => 'group',
- 'id' => 'g_feb',
- 'name' => 'February Options',
- 'visible' => ['s', 'feb'],
- 'fields' => [
- [
- 'id' => 'l_feb',
- 'name' => 'Location',
- ],
- ],
- ],
- ],
- ];
- return $meta_boxes;
- } );
Advertisement
Add Comment
Please, Sign In to add comment