WYSIWYG Not Working Properly
Support › Meta Box AIO › WYSIWYG Not Working Properly
- This topic has 10 replies, 6 voices, and was last updated 1 year, 6 months ago by
Adsolut Web Agency.
-
AuthorPosts
-
January 20, 2022 at 1:01 AM #33339
Alisha Thomas
ParticipantHello! I am having a couple of issues with the WYSIWYG custom field.
In one CPT/custom field, the WYSIWYG is not saving the "p" tags when pressing enter/return using the visual editor. This means, when I dynamic insert the data on a page, it is create one large paragraph, instead of multiple paragraphs. The only way I can get it to work is by switching to the text editor and manually putting in the open and close "p" tags. These should automatically be input when using enter/return on the visual editor.
on another CPT/custom field, the WYSIWYG is completely broken. It shows I am viewing the visual editor, but none of the edit buttons are visible. In addition, the content box is blank, I can not type in the editor, and I can't click to switch to the text editor view. It simply does not work. If I switch this custom field to a Text Area, I can then see my typed text is still there, but as soon as I switch it back to the WYSIWYG option, I am back to the same issue.
January 20, 2022 at 11:05 PM #33353Long Nguyen
ModeratorHi Alisha,
Can you please share the code that creates the fields on your site? Refer to this documentation to generate PHP code https://docs.metabox.io/extensions/meta-box-builder/#getting-php-code
January 20, 2022 at 11:37 PM #33358Alisha Thomas
ParticipantHere is the code for the WYSIWYG fields that are not saving the p tags:
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Lead Magnets', 'your-text-domain' ), 'id' => 'lead-magnets', 'post_types' => ['resources'], 'context' => 'after_title', 'fields' => [ [ 'name' => __( 'Funnel Pack Name', 'your-text-domain' ), 'id' => $prefix . 'funnel_pack_name', 'type' => 'text', ], [ 'name' => __( 'Lead Magnet Name', 'your-text-domain' ), 'id' => $prefix . 'lead_magnet_name', 'type' => 'text', ], [ 'name' => __( 'Hero', 'your-text-domain' ), 'id' => $prefix . 'hero', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Hero Headline', 'your-text-domain' ), 'id' => $prefix . 'hero_headline', 'type' => 'text', ], [ 'name' => __( 'Lede text', 'your-text-domain' ), 'id' => $prefix . 'lede_text', 'type' => 'wysiwyg', ], [ 'name' => __( 'Button Text', 'your-text-domain' ), 'id' => $prefix . 'button_text', 'type' => 'text', 'std' => 'Send Me My Free Guide', ], ], ], [ 'name' => __( 'Main Content', 'your-text-domain' ), 'id' => $prefix . 'main_content', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Secondary Headline', 'your-text-domain' ), 'id' => $prefix . 'secondary_headline', 'type' => 'text', ], [ 'name' => __( 'Body Copy', 'your-text-domain' ), 'id' => $prefix . 'body_copy', 'type' => 'wysiwyg', ], [ 'name' => __( 'Bullet Point 1', 'your-text-domain' ), 'id' => $prefix . 'bullet_point_1', 'type' => 'text', ], [ 'name' => __( 'Bullet Point 2', 'your-text-domain' ), 'id' => $prefix . 'bullet_point_2', 'type' => 'text', ], [ 'name' => __( 'Bullet Point 3', 'your-text-domain' ), 'id' => $prefix . 'bullet_point_3', 'type' => 'text', ], [ 'name' => __( 'Bullet Point 4', 'your-text-domain' ), 'id' => $prefix . 'bullet_point_4', 'type' => 'text', ], [ 'name' => __( 'Bullet Point 5', 'your-text-domain' ), 'id' => $prefix . 'bullet_point_5', 'type' => 'text', ], [ 'name' => __( 'Bullet Point 6', 'your-text-domain' ), 'id' => $prefix . 'bullet_point_6', 'type' => 'text', ], ], ], [ 'name' => __( 'Popup', 'your-text-domain' ), 'id' => $prefix . 'popup', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Popup Headline', 'your-text-domain' ), 'id' => $prefix . 'popup_headline', 'type' => 'text', ], [ 'name' => __( 'Popup Lede', 'your-text-domain' ), 'id' => $prefix . 'popup_lede', 'type' => 'wysiwyg', ], ], ], [ 'name' => __( 'Cover Image', 'your-text-domain' ), 'id' => $prefix . 'cover_image', 'type' => 'image_advanced', ], [ 'name' => __( 'Fluent Form Data', 'your-text-domain' ), 'id' => $prefix . 'fluent_form_data', 'type' => 'text', 'desc' => __( 'Enter the unique slug for this lead magnet request.', 'your-text-domain' ), ], ], ]; return $meta_boxes; }
Here is the code for the WYSIWYG field that is completely broken:
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'FAQ', 'your-text-domain' ), 'id' => 'faq', 'post_types' => ['faqs'], 'fields' => [ [ 'name' => __( 'FAQ: Answer', 'your-text-domain' ), 'id' => $prefix . 'faq:_answer', 'type' => 'wysiwyg', ], ], ]; return $meta_boxes; }
January 21, 2022 at 2:49 PM #33375Long Nguyen
ModeratorHi,
Thanks for your additional information.
- Regarding the
wysiwyg
field under the post typeresources
, I see that issue. Thewysiwyg
field is not working properly as a subfield in a group. I will inform the development team to check and fix this. -
Regarding the
wysiwyg
field under the post typefaq
, the field ID must not include the special characters. Should be only numbers, letters, and underscores (and rarely dashes).
[ 'name' => __( 'FAQ: Answer', 'your-text-domain' ), 'id' => $prefix . 'faq_answer', 'type' => 'wysiwyg', ]
Refer to this documentation https://docs.metabox.io/field-settings/#general
January 21, 2022 at 10:03 PM #33378Alisha Thomas
ParticipantI was able to fix the issue with the wysiwyg field under the faq post type. Hopefully there will be a fix quickly for the wysiwyg field as a subfiled in a group. Thank you!
February 14, 2023 at 7:59 PM #40511Tobias Haas
ParticipantI have the same error. Usually I could solve this by clicking "Save data in the raw format", but that doesn't work anymore.
Bricks Builder always inserts an empty <p> tag at the beginning and end.
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Single Post', 'your-text-domain' ), 'id' => 'single-post', 'post_types' => ['service', 'post', 'prozess'], 'fields' => [ [ 'name' => __( 'Single Post Sections', 'your-text-domain' ), 'id' => $prefix . 'single-post-sections', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'fields' => [ [ 'name' => __( 'Template', 'your-text-domain' ), 'id' => $prefix . 'template-sections', 'type' => 'select', 'options' => [ 'grauebox-section' => __( 'Graue Box', 'your-text-domain' ), 'standard-content' => __( 'Standard Box', 'your-text-domain' ), 'pdf-section' => __( 'PDF', 'your-text-domain' ), ], ], [ 'name' => __( 'Graue Box', 'your-text-domain' ), 'id' => $prefix . 'grauebox-section', 'type' => 'group', 'collapsible' => true, 'fields' => [ [ 'name' => __( 'Heading', 'your-text-domain' ), 'id' => $prefix . 'heading', 'type' => 'text', ], [ 'name' => __( 'Subheading', 'your-text-domain' ), 'id' => $prefix . 'subheading', 'type' => 'text', ], [ 'name' => __( 'Wysiwyg', 'your-text-domain' ), 'id' => $prefix . 'wysiwyg_grauebox', 'type' => 'wysiwyg', 'options' => [ 'media_buttons' => false, ], ], [ 'name' => __( 'Fußzeile', 'your-text-domain' ), 'id' => $prefix . 'fusszeile', 'type' => 'textarea', 'rows' => 6, ], ], 'visible' => [ 'when' => [['template-sections', '=', 'grauebox-section']], 'relation' => 'or', ], ], [ 'name' => __( 'Standard Content', 'your-text-domain' ), 'id' => $prefix . 'standard-content', 'type' => 'group', 'collapsible' => true, 'fields' => [ [ 'name' => __( 'Wysiwyg', 'your-text-domain' ), 'id' => $prefix . 'wysiwyg_standard', 'type' => 'wysiwyg', 'options' => [ 'media_buttons' => false, ], ], ], 'visible' => [ 'when' => [['template-sections', '=', 'standard-content']], 'relation' => 'or', ], ], [ 'name' => __( 'PDF', 'your-text-domain' ), 'id' => $prefix . 'pdf-section', 'type' => 'group', 'collapsible' => true, 'fields' => [ [ 'name' => __( 'Text', 'your-text-domain' ), 'id' => $prefix . 'text_pdf', 'type' => 'text', ], [ 'name' => __( 'Button Text', 'your-text-domain' ), 'id' => $prefix . 'button_text_pdf', 'type' => 'text', ], [ 'name' => __( 'File Advanced', 'your-text-domain' ), 'id' => $prefix . 'file_advanced_pdf', 'type' => 'file_advanced', 'max_file_uploads' => 1, ], ], 'visible' => [ 'when' => [['template-sections', '=', 'pdf-section']], 'relation' => 'or', ], ], ], ], ], ]; return $meta_boxes; }
Hope you can Help! Thanks
TobiasFebruary 17, 2023 at 4:55 PM #40572Motiveink
ParticipantThe wysiwyg field is not working properly as a subfield in a group.
have you solved this problem?February 17, 2023 at 5:05 PM #40573Tobias Haas
ParticipantOkay it's fixed in Bricks 1.7 Beta.
February 17, 2023 at 8:47 PM #40574Alisha Thomas
ParticipantThanks for the update, Tobias!!
July 15, 2023 at 1:50 AM #42578Marcel Wolf
ParticipantThe wysiwyg field is not working properly as a subfield in a group.
In Oxygen Builder not solved!
When is this solved?October 8, 2023 at 1:31 PM #43459Adsolut Web Agency
ParticipantIs this fixed yet ?
i am using AIO to create wysiwyg blocks. they are not under groups but in tabs. the visual editor works as expected but when switched to the text editor, the editor becomes non-clickable and nothing can by typed in it anymore.Metabox: 5.8.1
AIO : 1.23.1
Wordpress : 6.3.1the generated php code is as follows
<?php add_filter( 'rwmb_meta_boxes', 'qualiv_reports_constructions' ); function qualiv_reports_constructions( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Report Single - Construction - Content', 'qualiv' ), 'id' => 'report-single-content', 'post_types' => ['reports'], 'include' => [ 'relation' => 'OR', 'report-layout' => [30], ], 'tabs' => [ 'main' => [ 'label' => 'Main', 'icon' => '', ], 'collaborators-tab' => [ 'label' => 'Collaborators', 'icon' => '', ], 'split_content_tab' => [ 'label' => 'Split Content', 'icon' => '', ], 'timeline_tab' => [ 'label' => 'Timeline', 'icon' => '', ], ], 'fields' => [ [ 'name' => __( 'Info Table', 'qualiv' ), 'id' => $prefix . 'info_table', 'type' => 'group', 'collapsible' => true, 'group_title' => '{label}', 'clone' => true, 'sort_clone' => true, 'fields' => [ [ 'name' => __( 'Label', 'qualiv' ), 'id' => $prefix . 'label', 'type' => 'text', 'columns' => 4, 'datalist' => [ 'id' => '65224c4e372c9', 'options' => [ 'Address ', 'Size of Plot ', 'Construction Volume ', 'Timeline', ], ], ], [ 'name' => __( 'Content', 'qualiv' ), 'id' => $prefix . 'content', 'type' => 'textarea', 'rows' => 2, 'columns' => 8, ], ], 'tab' => 'main', ], [ 'name' => __( 'Collaborators Title', 'qualiv' ), 'id' => $prefix . 'collaborators_title', 'type' => 'text', 'std' => 'Collaborators', 'save_field' => false, 'tab' => 'collaborators-tab', ], [ 'name' => __( 'Collaborators', 'qualiv' ), 'id' => $prefix . 'collaborators_carousel', 'type' => 'image_advanced', 'tab' => 'collaborators-tab', ], [ 'name' => __( 'Left Block', 'qualiv' ), 'id' => $prefix . 'left_side_description', 'type' => 'wysiwyg', 'options' => [ 'textarea_rows' => 8, 'media_buttons' => false, ], 'sanitize_callback' => 'none', 'tab' => 'split_content_tab', ], [ 'name' => __( 'Right Block', 'qualiv' ), 'id' => $prefix . 'right_side_description', 'type' => 'wysiwyg', 'options' => [ 'textarea_rows' => 8, 'media_buttons' => false, ], 'sanitize_callback' => 'none', 'tab' => 'split_content_tab', ], [ 'name' => __( 'Timeline Title', 'qualiv' ), 'id' => $prefix . 'timeline_title', 'type' => 'text', 'std' => 'Timeline', 'columns' => 6, 'save_field' => false, 'tab' => 'timeline_tab', ], [ 'name' => __( 'Timeline Image', 'qualiv' ), 'id' => $prefix . 'timeline_image', 'type' => 'single_image', 'columns' => 6, 'tab' => 'timeline_tab', ], ], ]; return $meta_boxes; }
- Regarding the
-
AuthorPosts
- You must be logged in to reply to this topic.