Customize WordPress WYSIWYG Editor

The default editor is set to always generate xHTML 1.0 and thus not all tags are allowed; a classic example are iframes, which you use for Google Map for example. Sure there are other approaches via short code, etc., but this is not the today topic. Merely as an example, allowing the tag <span class="pln">iframe</span>, with various attributes, and the Tags must be added to the variable <span class="pln">$ext</span>.

function fb_change_mce_options($initArray) {
	// Comma separated string od extendes tags
	// Command separated string of extended elements
	$ext = 'pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]';

	if ( isset( $initArray['extended_valid_elements'] ) ) {
		$initArray['extended_valid_elements'] .= ',' . $ext;
	} else {
		$initArray['extended_valid_elements'] = $ext;
	}
	// maybe; set tiny paramter verify_html
	//$initArray['verify_html'] = false;

	return $initArray;
}
add_filter('tiny_mce_before_init', 'fb_change_mce_options');