Support Forum
Support › Meta Box Builder › WYSYWG editor delets content!Resolved
The custom field WYSYWG editor shows a very, very strange behavior: If it used with the plugin Display Posts (https://de.wordpress.org/plugins/display-posts-shortcode/) on a site it delets content when the site is saved. When I use WP Pods to have a WYSYWG editor field on the site the problem does not exist. Is this a bug or a feature of Meta Box? Thanks for your help.
Hi Andreas,
Thank you for reaching out.
I've installed and activated the plugin Display Posts on my local site. After editing and save a post with a WYSIWYG field, I see the field saves data as well. Please follow the Debugging Information step and see if it works. If it still does not work, please share the code that creates the WYSIWYG field. Using the option "Get PHP Code" https://docs.metabox.io/extensions/meta-box-builder/#getting-php-code, I will check it out.
Hi Long,
first of all: Thank you for mentioning Immolist Mallorca in the showcase! And thanks for the quick reply.
- The debugging information does not show any hint what is wrong
- The php code is attached below.
- In a short video you can see whats happens:
https://drive.google.com/file/d/1BLts2zzSQkgMrjrI4ulwO8ovARwwW2MI/view
It seems to be a very rare case. I occurs only when I put the shortcode in the standard content editor of a page. The same shortecode in the custom field works without any problem. It is not a big thing for me since I can build up the site without the shortcode in the standard content editor. Generally I am very happy with Metabox.
Kind regards, Andreas
<?php
add_filter( 'rwmb_meta_boxes', 'il_pagefields' );
function il_pagefields( $meta_boxes ) {
$prefix = '';
$meta_boxes[] = [
'title' => __( 'PageFields', 'il-mallorca' ),
'id' => 'pagefields',
'post_types' => ['page'],
'priority' => 'low',
'fields' => [
[
'name' => __( 'Extratext', 'il-mallorca' ),
'id' => $prefix . 'extratext',
'type' => 'wysiwyg',
],
[
'name' => __( 'Schemadata', 'il-mallorca' ),
'id' => $prefix . 'schemadata',
'type' => 'textarea',
'label_description' => __( 'Schema', 'il-mallorca' ),
'save_field' => 1,
],
],
];
return $meta_boxes;
}