Wysiwyg is output as wall of text
Support › MB Elementor Integrator › Wysiwyg is output as wall of text
- This topic has 2 replies, 2 voices, and was last updated 1 year, 7 months ago by
Peter.
-
AuthorPosts
-
September 1, 2023 at 10:43 PM #43117
Kara
ParticipantHi there -
I have a WYSIWYG that holds a bunch of texts with many line breaks.
Looks fine in the back end, but on the front end, all line breaks are removed.Backend screenshot:https://www.awesomescreenshot.com/image/42635677?key=9db2acf128a9c9dada3457dfb96eaf1c
Frontend screenshot: https://www.awesomescreenshot.com/image/42635658?key=27d5a8858223f3b2fad7d2b059072d6e
Elementor widget: https://tinyurl.com/28tbjnt3
What am I doing wrong?
Note - if this is a bug with the Elementor integrator, I don't mind displaying this field via shortcode but I'm not sure what the structure is - could you help with that?
This custom field (transcript) is part of a sub-group - here's the sub-group code:
<div> <?php $group = rwmb_meta( 'seminars_webinars' ); // Field seminar-shortcode: echo $group[ 'seminar-shortcode' ] ?? ''; // Field transcript: // Get Wysiwyg in group $value = $group[ 'transcript' ] ?? ''; echo do_shortcode( wpautop( $value ) ); // Field chat: // Get Wysiwyg in group $value = $group[ 'chat' ] ?? ''; echo do_shortcode( wpautop( $value ) ); // Field links_from_webinar: <?php $groups = rwmb_meta( 'links_from_webinar' ); foreach ( $groups as $group ) { // Field link_text: echo $group[ 'link_text' ] ?? ''; // Field link_url: echo $group[ 'link_url' ] ?? ''; } ?>?> </div>
And the full code for the entire custom fields group:
<div> <?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Member Contents Wizard', 'your-text-domain' ), 'id' => 'member-contents-wizard', 'post_types' => ['member-content'], 'tabs' => [ 'categorize' => [ 'label' => 'Categorize', 'icon' => '', ], 'describe' => [ 'label' => 'Describe', 'icon' => '', ], 'access-links' => [ 'label' => 'Access Links', 'icon' => '', ], ], 'fields' => [ [ 'type' => 'heading', 'name' => __( 'All Resources', 'your-text-domain' ), 'desc' => __( 'Complete all three tabbed sections for every resource.', 'your-text-domain' ), 'tab' => 'categorize', ], [ 'name' => __( 'Which bucket does this go into', 'your-text-domain' ), 'id' => $prefix . 'which_bucket_does_this_go_into', 'type' => 'button_group', 'options' => [ 'Resource' => __( 'Resource', 'your-text-domain' ), 'Training' => __( 'Training', 'your-text-domain' ), 'Community' => __( 'Community', 'your-text-domain' ), ], 'required' => true, 'tab' => 'categorize', ], [ 'name' => __( 'Resource Category', 'your-text-domain' ), 'id' => $prefix . 'resource_category', 'type' => 'taxonomy', 'taxonomy' => ['resource'], 'field_type' => 'select_advanced', 'remove_default' => true, 'visible' => [ 'when' => [['which_bucket_does_this_go_into', '=', 'Resource']], 'relation' => 'and', ], 'tab' => 'categorize', ], [ 'name' => __( 'Training Category', 'your-text-domain' ), 'id' => $prefix . 'training_category', 'type' => 'taxonomy', 'taxonomy' => ['training'], 'field_type' => 'select_advanced', 'remove_default' => true, 'visible' => [ 'when' => [['which_bucket_does_this_go_into', '=', 'Training']], 'relation' => 'and', ], 'tab' => 'categorize', ], [ 'name' => __( 'Community Category', 'your-text-domain' ), 'id' => $prefix . 'community_category', 'type' => 'taxonomy', 'taxonomy' => ['community'], 'field_type' => 'select_advanced', 'remove_default' => true, 'visible' => [ 'when' => [['which_bucket_does_this_go_into', '=', 'Community']], 'relation' => 'and', ], 'tab' => 'categorize', ], [ 'type' => 'divider', 'save_field' => false, 'tab' => 'categorize', ], [ 'name' => __( 'Format', 'your-text-domain' ), 'id' => $prefix . 'format', 'type' => 'taxonomy', 'taxonomy' => ['format'], 'field_type' => 'checkbox_list', 'remove_default' => true, 'columns' => 4, 'tab' => 'categorize', ], [ 'name' => __( 'Department', 'your-text-domain' ), 'id' => $prefix . 'department', 'type' => 'taxonomy', 'taxonomy' => ['department'], 'field_type' => 'checkbox_tree', 'remove_default' => true, 'columns' => 4, 'tab' => 'categorize', ], [ 'name' => __( 'Department Topics', 'your-text-domain' ), 'id' => $prefix . 'department_topics', 'type' => 'taxonomy', 'taxonomy' => ['topic'], 'field_type' => 'checkbox_tree', 'remove_default' => true, 'columns' => 4, 'tab' => 'categorize', ], [ 'type' => 'divider', 'save_field' => false, 'tab' => 'categorize', ], [ 'type' => 'divider', 'save_field' => false, 'tab' => 'categorize', ], [ 'name' => __( 'How or when to use', 'your-text-domain' ), 'id' => $prefix . 'how_to_use', 'type' => 'wysiwyg', 'label_description' => __( 'Keep this short, 2-3 sentences if possible', 'your-text-domain' ), 'tab' => 'describe', ], [ 'name' => __( 'Description of Content', 'your-text-domain' ), 'id' => $prefix . 'description_of_content', 'type' => 'wysiwyg', 'tab' => 'describe', ], [ 'name' => __( 'Books', 'your-text-domain' ), 'id' => $prefix . 'books', 'type' => 'group', 'fields' => [ [ 'name' => __( 'PDF Version URL', 'your-text-domain' ), 'id' => $prefix . 'pdf_version', 'type' => 'url', 'columns' => 8, ], [ 'name' => __( 'PDF File Size', 'your-text-domain' ), 'id' => $prefix . 'pdf_file_size', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'Audio Book URL', 'your-text-domain' ), 'id' => $prefix . 'audio_book', 'type' => 'url', 'columns' => 8, ], [ 'name' => __( 'Audio Book File Size', 'your-text-domain' ), 'id' => $prefix . 'audio_book_file_size', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'Kindle Book URL', 'your-text-domain' ), 'id' => $prefix . 'kindle_book', 'type' => 'url', 'columns' => 8, ], [ 'name' => __( 'Kindle Book File Size', 'your-text-domain' ), 'id' => $prefix . 'kindle_book_file_size', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'ePub Book URL', 'your-text-domain' ), 'id' => $prefix . 'epub_book_url', 'type' => 'url', 'columns' => 8, ], [ 'name' => __( 'ePub Book File Size', 'your-text-domain' ), 'id' => $prefix . 'epub_book_file_size', 'type' => 'text', 'columns' => 4, ], [ 'type' => 'divider', 'save_field' => false, ], [ 'name' => __( 'All Handouts (zip file)', 'your-text-domain' ), 'id' => $prefix . 'all_handouts_zip_file', 'type' => 'url', 'columns' => 8, ], [ 'name' => __( 'All Handouts (zip file) File Size', 'your-text-domain' ), 'id' => $prefix . 'all_handouts_zip_file_file_size', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'Individual Handouts', 'your-text-domain' ), 'id' => $prefix . 'group_pust0lmjxd', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Add another download/handout', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Link Text', 'your-text-domain' ), 'id' => $prefix . 'link_text', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'File Size', 'your-text-domain' ), 'id' => $prefix . 'file_size', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'File Type', 'your-text-domain' ), 'id' => $prefix . 'file_type', 'type' => 'select', 'options' => [ 'pdf' => __( 'pdf', 'your-text-domain' ), 'docx' => __( 'docx', 'your-text-domain' ), 'xlsx' => __( 'xlsx', 'your-text-domain' ), 'zip [mp3]' => __( 'zip [mp3]', 'your-text-domain' ), 'epub' => __( 'epub', 'your-text-domain' ), 'mobi' => __( 'mobi', 'your-text-domain' ), 'txt' => __( 'txt', 'your-text-domain' ), ], 'columns' => 4, ], [ 'name' => __( 'Url', 'your-text-domain' ), 'id' => $prefix . 'url_8gisfy8qixg', 'type' => 'url', ], ], ], ], 'visible' => [ 'when' => [['resource_category', '=', 63]], 'relation' => 'and', ], 'tab' => 'access-links', ], [ 'name' => __( 'Seminars/Webinars', 'your-text-domain' ), 'id' => $prefix . 'seminars_webinars', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Audio/Video Shortcode', 'your-text-domain' ), 'id' => $prefix . 'seminar-shortcode', 'type' => 'text', 'desc' => __( 'This shortcode comes from PrestoPlayer Media Hub: https://smallbizthoughts.org/wp-admin/edit.php?post_type=pp_video_block', 'your-text-domain' ), ], [ 'name' => __( 'Transcript', 'your-text-domain' ), 'id' => $prefix . 'transcript', 'type' => 'wysiwyg', 'options' => [ 'wpautop' => true, ], 'columns' => 6, ], [ 'name' => __( 'Chat', 'your-text-domain' ), 'id' => $prefix . 'chat', 'type' => 'wysiwyg', 'columns' => 6, ], [ 'name' => __( 'External Links from webinar', 'your-text-domain' ), 'id' => $prefix . 'links_from_webinar', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Add another link', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Link Text', 'your-text-domain' ), 'id' => $prefix . 'link_text', 'type' => 'text', ], [ 'name' => __( 'Link Url', 'your-text-domain' ), 'id' => $prefix . 'link_url', 'type' => 'url', ], ], ], ], 'visible' => [ 'when' => [['training_category', '=', 75]], 'relation' => 'or', ], 'tab' => 'access-links', ], [ 'name' => __( 'Roundtables', 'your-text-domain' ), 'id' => $prefix . 'roundtables', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Vimeo URL', 'your-text-domain' ), 'id' => $prefix . 'vimeo_url', 'type' => 'url', ], [ 'name' => __( 'Guest information', 'your-text-domain' ), 'id' => $prefix . 'guest_information', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Name', 'your-text-domain' ), 'id' => $prefix . 'guests_name', 'type' => 'text', ], [ 'name' => __( 'Title', 'your-text-domain' ), 'id' => $prefix . 'guest_title', 'type' => 'text', ], [ 'name' => __( 'Company', 'your-text-domain' ), 'id' => $prefix . 'company', 'type' => 'text', ], [ 'name' => __( 'Headshot', 'your-text-domain' ), 'id' => $prefix . 'guest_headshot', 'type' => 'single_image', ], ], ], [ 'name' => __( 'Description', 'your-text-domain' ), 'id' => $prefix . 'description', 'type' => 'wysiwyg', ], [ 'name' => __( 'Transcript', 'your-text-domain' ), 'id' => $prefix . 'transcript', 'type' => 'wysiwyg', 'options' => [ 'media_buttons' => false, '' => '', ], ], [ 'name' => __( 'Chat', 'your-text-domain' ), 'id' => $prefix . 'chat', 'type' => 'wysiwyg', ], [ 'name' => __( 'Links from Roundtable', 'your-text-domain' ), 'id' => $prefix . 'links_from_webinar', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Add another link', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Link Text', 'your-text-domain' ), 'id' => $prefix . 'link_text', 'type' => 'text', ], [ 'name' => __( 'Link Url', 'your-text-domain' ), 'id' => $prefix . 'link_url', 'type' => 'url', ], ], ], ], 'visible' => [ 'when' => [['community_category', '=', 78]], 'relation' => 'or', ], 'tab' => 'access-links', ], [ 'name' => __( 'Three-Part Classes', 'your-text-domain' ), 'id' => $prefix . 'three_part_classes', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Part 1', 'your-text-domain' ), 'id' => $prefix . 'part_1', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Part 1 Title', 'your-text-domain' ), 'id' => $prefix . 'part_1_title', 'type' => 'text', ], [ 'name' => __( 'p1-Vimeo shortcode', 'your-text-domain' ), 'id' => $prefix . 'p1_vimeo_shortcode', 'type' => 'text', 'desc' => __( 'This shortcode comes from PrestoPlayer Media Hub: https://smallbizthoughts.org/wp-admin/edit.php?post_type=pp_video_block', 'your-text-domain' ), ], [ 'name' => __( 'P1-Description', 'your-text-domain' ), 'id' => $prefix . 'p1_description', 'type' => 'wysiwyg', ], [ 'name' => __( 'P1-Transcript', 'your-text-domain' ), 'id' => $prefix . 'p1_transcript', 'type' => 'wysiwyg', ], [ 'name' => __( 'P1-Links from webinar', 'your-text-domain' ), 'id' => $prefix . 'p1_links_from_webinar', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Add another link', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Link Text', 'your-text-domain' ), 'id' => $prefix . 'link_text', 'type' => 'text', ], [ 'name' => __( 'Link Url', 'your-text-domain' ), 'id' => $prefix . 'link_url', 'type' => 'url', ], ], ], ], ], [ 'type' => 'divider', 'save_field' => false, ], [ 'name' => __( 'Part 2', 'your-text-domain' ), 'id' => $prefix . 'part_2', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Part 2 Title', 'your-text-domain' ), 'id' => $prefix . 'part_2_title', 'type' => 'text', ], [ 'name' => __( 'p2-Vimeo shortcode', 'your-text-domain' ), 'id' => $prefix . 'p2-vimeo_shortcode', 'type' => 'text', 'desc' => __( 'This shortcode comes from PrestoPlayer Media Hub: https://smallbizthoughts.org/wp-admin/edit.php?post_type=pp_video_block', 'your-text-domain' ), ], [ 'name' => __( 'P2-Description', 'your-text-domain' ), 'id' => $prefix . 'p2_description', 'type' => 'wysiwyg', ], [ 'name' => __( 'P2-Transcript', 'your-text-domain' ), 'id' => $prefix . 'p2_transcript', 'type' => 'wysiwyg', ], [ 'name' => __( 'P2-Links from webinar', 'your-text-domain' ), 'id' => $prefix . 'p2_links_from_webinar', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Add another link', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Link Text', 'your-text-domain' ), 'id' => $prefix . 'link_text', 'type' => 'text', ], [ 'name' => __( 'Link Url', 'your-text-domain' ), 'id' => $prefix . 'link_url', 'type' => 'url', ], ], ], ], ], [ 'type' => 'divider', 'save_field' => false, ], [ 'name' => __( 'Part 3', 'your-text-domain' ), 'id' => $prefix . 'part_3', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Part 3 Title', 'your-text-domain' ), 'id' => $prefix . 'part_3_title', 'type' => 'text', ], [ 'name' => __( 'p3-Vimeo shortcode', 'your-text-domain' ), 'id' => $prefix . 'p3-vimeo_shortcode', 'type' => 'text', 'desc' => __( 'This shortcode comes from PrestoPlayer Media Hub: https://smallbizthoughts.org/wp-admin/edit.php?post_type=pp_video_block', 'your-text-domain' ), ], [ 'name' => __( 'P3-Description', 'your-text-domain' ), 'id' => $prefix . 'p3_description', 'type' => 'wysiwyg', ], [ 'name' => __( 'P3-Transcript', 'your-text-domain' ), 'id' => $prefix . 'p3_transcript', 'type' => 'wysiwyg', ], [ 'name' => __( 'P3-Links from webinar', 'your-text-domain' ), 'id' => $prefix . 'p3_links_from_webinar', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Add another link', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Link Text', 'your-text-domain' ), 'id' => $prefix . 'link_text', 'type' => 'text', ], [ 'name' => __( 'Link Url', 'your-text-domain' ), 'id' => $prefix . 'link_url', 'type' => 'url', ], ], ], ], ], ], 'visible' => [ 'when' => [['training_category', '=', 74]], 'relation' => 'or', ], 'tab' => 'access-links', ], [ 'name' => __( 'Download Button', 'your-text-domain' ), 'id' => $prefix . 'group_eufpzvxddin', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Download Links', 'your-text-domain' ), 'id' => $prefix . 'download_links', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Add another download/handout', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Link Text', 'your-text-domain' ), 'id' => $prefix . 'gen_download_link_text', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'File Size', 'your-text-domain' ), 'id' => $prefix . 'gen_download_file_size', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'File Type', 'your-text-domain' ), 'id' => $prefix . 'gen_download_file_type', 'type' => 'select', 'options' => [ 'pdf' => __( 'pdf', 'your-text-domain' ), 'docx' => __( 'docx', 'your-text-domain' ), 'xlsx' => __( 'xlsx', 'your-text-domain' ), 'zip [mp3]' => __( 'zip [mp3]', 'your-text-domain' ), 'epub' => __( 'epub', 'your-text-domain' ), 'mobi' => __( 'mobi', 'your-text-domain' ), 'txt' => __( 'txt', 'your-text-domain' ), ], 'columns' => 4, ], [ 'name' => __( 'Url', 'your-text-domain' ), 'id' => $prefix . 'gen_download_url', 'type' => 'url', ], ], ], [ 'type' => 'heading', 'name' => __( 'Extras', 'your-text-domain' ), 'desc' => __( 'Some resources have accompanying videos, for example, that aren\'t the main resource, but are useful. Add those here. An example is the 68 Point Checklist that has 2 YouTube videos to help explain.', 'your-text-domain' ), 'hidden' => [ 'when' => [['training_category', '=', 75]], 'relation' => 'or', ], ], [ 'name' => __( 'Extras', 'your-text-domain' ), 'id' => $prefix . 'extras', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Add another download/handout', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Video Title', 'your-text-domain' ), 'id' => $prefix . 'extras-video-title', 'type' => 'text', 'columns' => 4, ], [ 'name' => __( 'Video Shortcode', 'your-text-domain' ), 'id' => $prefix . 'extras_video_shortcode', 'type' => 'text', 'label_description' => __( 'First add the video to PrestoPlayer and get the shortcode from there.', 'your-text-domain' ), 'columns' => 4, ], ], 'hidden' => [ 'when' => [['training_category', '=', 75]], 'relation' => 'or', ], ], ], 'tab' => 'access-links', ], ], ]; return $meta_boxes; } </div>
Thank you.
September 1, 2023 at 10:44 PM #43118Kara
ParticipantOh, and using MetaBox Builder / AIO if that matters.
September 4, 2023 at 7:10 PM #43130Peter
ModeratorHello,
Please try to remove the wpautop option in your code and recheck this issue
'options' => [ 'wpautop' => true, ],
I removed it and the
<p>
tags are added properly on my demo site. -
AuthorPosts
- You must be logged in to reply to this topic.