Advertisement
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 Text',
- 'id' => 'text-trigger',
- 'type' => 'block',
- 'icon' => 'awards',
- 'category' => 'tsm',
- 'context' => 'side',
- 'render_callback' => function() {
- echo 'This is the block content';
- },
- 'fields' => [
- [
- 'id' => 'triggers',
- 'type' => 'group',
- 'name' => 'Контент',
- 'clone' => true,
- 'sort_clone' => true,
- 'add_button' => '+',
- 'collapsible' => true,
- 'group_title' => 'Элемент {#}',
- 'save_state' => true,
- 'fields' => [
- [
- 'id' => 'icon',
- 'type' => 'single_image',
- 'name' => 'Иконка',
- ],
- [
- 'id' => 'text',
- 'type' => 'wysiwyg',
- 'name' => 'Текст',
- 'options' => [
- 'media_buttons' => false,
- 'teeny' => true,
- 'textarea_rows' => 10,
- 'tinymce' => [
- 'media_buttons' => false,
- 'drag_drop_upload' => false,
- 'content_css' => get_template_directory_uri() . '/assets/css/tinymce.min.css',
- 'toolbar1' => 'styleselect,bold,italic,bullist,numlist,link,unlink,fullscreen',
- 'toolbar2' => 'alignleft,aligncenter,alignright,undo,redo',
- 'style_formats' => [
- [
- 'title' => 'Имитация strong',
- 'inline' => 'span',
- 'classes' => 'strong'
- ],
- [
- 'title' => 'Имитация italic',
- 'inline' => 'span',
- 'classes' => 'em'
- ],
- ],
- ],
- 'quicktags' => [
- 'buttons' => 'strong,em,u,link,ul,ol,li',
- ],
- ],
- ],
- ]
- ],
- ],
- ];
- return $meta_boxes;
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement