Support Forum
So using a the WYSIWYG in a block and trying to pass button settings doesnt work
'options' => array(
'tinymce' => array(
'toolbar1' => 'bold, italic',
'toolbar2' => '',
),
),
In the end im trying to get the Format Select Dropdown to show because its not showing for me at all .
Hi,
Could you please share full the code to create the field WYSIWYG
? I will copy your code and check on my end.
Here is my sample code
function your_prefix_get_meta_box( $meta_boxes ) {
$prefix = 'prefix-';
$meta_boxes[] = array(
'id' => 'untitled',
'title' => esc_html__( 'Untitled Metabox', 'metabox-online-generator' ),
'post_types' => array('post', 'page' ),
'context' => 'advanced',
'priority' => 'default',
'autosave' => 'false',
'fields' => array(
array(
'id' => $prefix . 'wysiwyg_1',
'name' => esc_html__( 'WYSIWYG', 'metabox-online-generator' ),
'type' => 'wysiwyg',
'options' => array(
'tinymce' => array(
'toolbar1' => 'bold,italic',
'toolbar2' => '',
'toolbar3' => '',
),
),
),
),
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'your_prefix_get_meta_box' );
and it works as well https://share.getcloudapp.com/rRu9xWm1.
public function mjmc_block_half_video_half_text($meta_boxes) {
$meta_boxes[] = [
'title' => 'Half Video/Half Text',
'id' => 'half-video-half-text-content',
'description' => 'creates a block with 50% Video / 50% Text',
'type' => 'block',
'icon' => 'awards',
'category' => 'howell-blocks',
//'context' => 'side',
'render_callback' => 'mjmc_block_half_video_half_text_render',
//'enqueue_style' => get_template_directory_uri() . '/blocks/hero/style.css',
'supports' => [
'align' => ['full'],
'anchor' => true,
'customClassName' => true,
],
// Block fields.
'fields' => [
[
'type' => 'color',
'id' => 'background_color',
'name' => 'Background Color',
'js_options' => array(
'palettes' => array( '#004B87', '#FFC629', '#F3F3F3','#FF6B00', '#005CAB', '#3DAE2B')
),
],
[
'type' => 'text',
'id' => 'video_iframe',
'name' => 'Iframe Code'
],
[
'type' => 'select',
'id' => 'align_video',
'name' => 'Align Video',
'options' => array(
'left' => 'Left',
'right' => 'Right',
),
],
[
'type' => 'wysiwyg',
'id' => 'content',
'name' => 'Content',
'options' => array(
'tinymce' => array(
'toolbar1' => 'bold,italic',
'toolbar2' => '',
'toolbar3' => '',
),
),
]
],
];
return $meta_boxes;
}
the Tinymce tool bar doesnt change at all on my end. Other editor settings like: 'media_buttons' => FALSE works just fine.
Thank you, I will check it out and let you know later.
I seem to have the same issue here. Is there any update on this?
Hi! I have made a temporary solution for this purpose: https://support.metabox.io/topic/strange-wysiwyg-behavior-inside-group/#post-27514
Hey guys,
Thanks Jackky, the settings now works in this commit. I'll release the new version very soon.