I have a plugin where I am creating a shortcode that creates a form with a textarea field. I would like the user to be able to insert a complete HTML page into the editor - including the HTML and BODY tags and allow all HTML tags. Whenever I switch from Text to Visual view, paragraph tags get added and all but the H1 tags get removed.
I've tried several methods.
Method 1:
$html_code = "<html><head><title>title of page</title></head><body><h1>Page Heading</h1></body></html>"
$editor_id = "template_code";
$settings = array('textarea_name' => $editor_id, 'tinymce' => array ('toolbar1'=> 'bold,italic'), 'valid_elements'=>'*[*]');
wp_editor ( $html_code, $editor_id, $settings );
The toolbar settings are working, but the valid_elements has no effect.
Method 2:
function my_format_TinyMCE( $in ) {
$in['toolbar1'] = 'bold';
$in['toolbar2'] = 'italic';
$in['valid_elements'] = '*[*]';
$in['verify_html'] = false;
}
add_filter ( 'tiny_mce_before_init', 'my_Format_TinyMCE' );
http://codex.wordpress.org/Plugin_API/Filter_Reference/tiny_mce_before_init
And some that I can't remember.
It this even possible? If so, what am I missing?
TIA!!!