Configuring WYSIWYG Buttons not working
- This topic has 6 replies, 5 voices, and was last updated 3 years, 12 months ago by
Anh Tran.
-
AuthorPosts
-
May 21, 2020 at 2:25 AM #19723
Rebecca Rossi
ParticipantSo 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 .
May 21, 2020 at 10:13 AM #19728Long Nguyen
ModeratorHi,
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.
May 21, 2020 at 8:46 PM #19736Rebecca Rossi
Participantpublic 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.
May 22, 2020 at 9:28 AM #19742Long Nguyen
ModeratorThank you, I will check it out and let you know later.
August 4, 2020 at 3:26 PM #21119Key_Webdesign
ParticipantI seem to have the same issue here. Is there any update on this?
April 22, 2021 at 6:16 PM #27515Jackky
ParticipantHi! I have made a temporary solution for this purpose: https://support.metabox.io/topic/strange-wysiwyg-behavior-inside-group/#post-27514
April 24, 2021 at 4:45 PM #27597Anh Tran
KeymasterHey guys,
Thanks Jackky, the settings now works in this commit. I'll release the new version very soon.
-
AuthorPosts
- You must be logged in to reply to this topic.