Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'rwmb_meta_boxes', 'img_tab' );
- function img_tab( $meta_boxes ) {
- $prefix = 'img-tab-';
- $meta_boxes[] = [
- 'title' => __( 'Tab Bilderblöcke', 'soex' ),
- 'icon' => [
- 'background' => '',
- 'foreground' => '#0a0a0a',
- 'src' => 'index-card',
- ],
- 'category' => 'text',
- 'supports' => [
- 'align' => [''],
- ],
- 'type' => 'block',
- 'context' => 'content',
- 'render_template' => get_stylesheet_directory() . '/inc/metabox-blocks/block-img-tabs/template.php',
- 'enqueue_assets' => function(){
- wp_enqueue_script( 'tab-script', get_template_directory_uri() . '/inc/metabox-blocks/block-img-tabs/function.js' );
- wp_enqueue_style( 'tab-style' , get_template_directory_uri() . '/inc/metabox-blocks/block-img-tabs/style.css' );
- if(is_admin( )) {
- wp_enqueue_style( 'tab-admin-style' , get_template_directory_uri() . '/inc/metabox-blocks/block-img-tabs/style-admin.css' );
- }
- },
- 'fields' => [
- [
- 'id' => $prefix . 'group',
- 'type' => 'group',
- 'collapsible' => true,
- 'default_state' => 'collapsed',
- 'group_title' => '{'.$prefix.'heading}',
- 'clone' => true,
- 'max_clone' => 4,
- 'sort_clone' => true,
- 'fields' => [
- [
- 'name' => __( 'Hintergrundbild', 'soex' ),
- 'id' => $prefix . 'bgimg',
- 'type' => 'single_image',
- ],
- [
- 'name' => 'Überschriftentyp',
- 'id' => $prefix . 'heading_type',
- 'type' => 'select',
- 'multiple' => false,
- 'std' => 'h3',
- 'columns' => 5,
- 'tooltip' => [
- 'icon' => '',
- 'position' => 'top',
- 'content' => 'Für SEO relevant',
- ],
- 'options' => [
- 'h1' => 'h1',
- 'h2' => 'h2',
- 'h3' => 'h3',
- 'h4' => 'h4',
- 'h5' => 'h5',
- 'h6' => 'h6'
- ],
- ],
- [
- 'name' => __( 'Überschrift', 'soex' ),
- 'id' => $prefix . 'heading',
- 'type' => 'text',
- ],
- [
- 'name' => __( 'Inhaltstext', 'soex' ),
- 'id' => $prefix . 'content',
- 'type' => 'wysiwyg',
- 'options' => [
- 'teeny' => true,
- 'media_buttons' => false,
- ],
- ],
- ],
- ],
- ],
- ];
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement