html tags in tinyMCE meta box not being encoded on page
-
I have a meta box that uses tinyMCE instead of a plain textarea, but all html tags I use are simply being passed as text instead of correctly rendered on the page. Seems to be a filters issue, but I have no idea where to apply filters in the meta box functions. I would basically like to use exactly the same filters and html decoding in this meta box as are used in the post’s main tinyMCE-powered text area.
I added tinyMCE using this code:
$value = get_post_meta( $post->ID, 'new_field', true );
$editor_id = 'new_field';
$settings = array( 'media_buttons' => false );
wp_editor( $value , $editor_id, $settings );
When saving I apply esc_textarea:
$my_data = esc_textarea( $_POST['new_field'] );
Sometime between that and the page, the HTML tags just get ignored. Any suggestions appreciated.
- The topic ‘html tags in tinyMCE meta box not being encoded on page’ is closed to new replies.