jaredatch/Custom-Metaboxes-and-Fields-for-WordPress — Issue #91: WYSIWYG editor stripping HTML tags
Author: davidensor
Created: 2012-01-15 23:43:23+00:00
State: open

Is there a known issue related to the WYSIWYG CMB field stripping HTML tags on page save? Regardless of whether I use the editor or HTML, it strips out

and
tags after saving page and on next page editor load, the tags are gone (so that when the user tries to save again the formatting all runs together). I've had this issue on 2 different sites/hosts.

Running WP 3.3.1 and have the latest CMB code.

Here's a page example: http://steppingstonescenter.org/wp/about/ (see left sidebar area).

Before I call my page variables, I have:

ID, '_cmb_callout_title', true);
$callout_content = get_post_meta($post->ID, '_cmb_callout_content', true);

if ($callout_content != "") { ?>

In my functions.php, I have:

// Custom Metabox Creator
$prefix = '_cmb_'; // start with an underscore to hide fields from custom fields list
add_filter( 'cmb_meta_boxes', 'be_sample_metaboxes' );
function be_sample_metaboxes( $meta_boxes ) {
global $prefix;
$meta_boxes[] = array(
'id' => 'callout_metabox',
'title' => 'Call-out Area Metabox',
'pages' => array('page'), // post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
'fields' => array(
array(
'name' => 'Title',
'id' => $prefix . 'callout_title',
'type' => 'text'
),
array(
'name' => 'Content',
'id' => $prefix . 'callout_content',
'type' => 'wysiwyg',
'options' => array(
'textarea_rows' => 9,
)
),
)
);
return $meta_boxes;
}
// Initialize the metabox class
add_action( 'init', 'be_initialize_cmb_meta_boxes', 9999 );
function be_initialize_cmb_meta_boxes() {
if ( !class_exists( 'cmb_Meta_Box' ) ) {
require_once( TEMPLATEPATH . '/lib/metabox/init.php' );
}
}