Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mytheme_register_meta_boxes( $meta_boxes ){
- $prefix = 'mytheme';
- // Page builder
- $meta_boxes[] = array(
- 'id' => $prefix . 'page_builder',
- 'title' => esc_html__( 'Page Builder', 'mytheme' ),
- 'pages' => array( 'page' ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'show' => array(
- 'template' => array( 'page-builder.php' ),
- ),
- 'fields' => array(
- array(
- 'id' => $prefix . 'section',
- 'type' => 'group',
- 'collapsible' => true,
- 'clone' => true,
- 'group_title' => array(
- 'field' => 'section-select',
- ),
- 'sort_clone' => true,
- 'save_state' => true,
- // List of sub-fields
- 'fields' => array(
- array(
- 'name' => esc_html__('Section', 'mytheme'),
- 'id' => 'section-select',
- 'type' => 'select',
- 'placeholder' => esc_html__( 'Select a layout', 'mytheme' ),
- 'options' => array(
- 'fullwidth' => esc_html__( 'Fullwidth Section', 'mytheme' ),
- 'with-sidebar' => esc_html__( 'With Sidebar Section', 'mytheme' ),
- ),
- ),
- array(
- 'id' => $prefix . 'section-main-col',
- 'type' => 'group',
- 'collapsible' => true,
- 'clone' => true,
- 'group_title' => array(
- 'field' => 'section-main-col-select',
- ),
- 'sort_clone' => true,
- 'save_state' => true,
- // List of sub-fields
- 'fields' => array(
- array(
- 'name' => esc_html__('Section', 'mytheme'),
- 'id' => 'section-main-col-select',
- 'type' => 'select',
- 'placeholder' => esc_html__( 'Select a layout', 'mytheme' ),
- 'options' => array(
- 'posts-listing' => esc_html__( 'Posts Listing', 'mytheme' ),
- 'slider' => esc_html__( 'Slider', 'mytheme' ),
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- );
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement