Problems with the iframe tag and the WP editor
Don’t switch between editing tabs. Pick a tab and stick to it.
Sorry but that’s the reality of it. If you switch from the HTML to the Visual Editor whilst editing a post or page, you will lose some of your markup.
Mostly, it gets added, but why doesn’t the editor like <iframe>? It’s ridiculous. I’ve been switching back and forth ever since I started with WP and aside from the dreaded space tag and (a lot) of other niggly things, it generally leaves objects alone.
If I altered the tag from iframe to object or perhaps embed, would it work? After all it’s just a call to a location.
This plugin solved my problem with the disappearing inline frame tags in WordPress 3.1 page editing window: TSL iframe unfilter.
My research also turned up another possiblility but I did not try it as it looked more complicated for my enduser: PureHTML.
If you can’t supply a legitimate answer to a legitimate question (esmi) than don’t waste people’s time.
It’s apparent MNL345 located the answer and supplied it, that’s what forums are for and are supposed to do.
Thanks for the correct answer MNL345, it’s greatly appreciated.
Actually, I think esmi’s assessment was not only spot on, but is a pretty well known issue and has been a frequent topic (visual -vs – HTML mode, and the possible negative effects of flipping between the two editors) of discussion here in the forums. Look it up yourself, if you care to. The fact that someone found a plugin to assist in providing an “ease of use” solution for the iframe issue, is simply a great example of WordPress’s extensibility through plugins, and evidence of how specific some plugins can actually be in their nature – as well as of the fantastic work of plugin authors who contribute their time and expertise to share them with the WordPress community for free.
That being said, although the plugin being referred to here happened to work as desired in this case, it was already questionable in it’s compatibility with the OP’s version of WordPress when it was mentioned several months ago. So… How’s it working for you, still okay? If so, you might want to hop on over to the TSL iframe unfilter plugin compatibility box and cast your vote for “says it works” so others in the community will know the status for the current version of WordPress.
To be specific esmi wrote:
“Sorry but that’s the reality of it. If you switch from the HTML to the Visual Editor whilst editing a post or page, you will lose some of your markup.”
The reality of it is just what I wrote. There is a solution and forums are for solutions not drivel. esmi offered no solution only stating the status quo is too bad their is no solution. He was flat out incorrect in his “solution” which was no solution when one did, in fact, exist.
I agree with esmi (who happens to be a she, not a he) and ClaytonJames.
In its default configuration, WordPress is intended to be used such that one chooses either the Visual editor or the HTML editor, but not both.
There are solutions, to be true; but it is entirely relevant to point out that to implement such solutions involves modifying WordPress’s default configuration, and as such requires sufficient knowledge and understanding of what one is doing. Thus, esmi’s comment was appropriate.
The easiest fix is to filter the
$initconfiguration array that gets passed to TinyMCE (the Visual editor), so that IFRAME tags don’t get filtered. I’ve posted this fix several times here in the forums.
But, based on your admonishment of esmi regarding the proper use of forums, I assume you’ve already searched to find such previous answers, and already found them.
I searched, I found, I conquered.
The recommended filter plugin worked and continues to work fine with the latest version of WP.
Also, I voted in the affirmative at the plugin site and highly recommended to correct the problems that occur with retaining the <iframe> code intact when switching between editor and html tabs in WP.
It’s all good! (TSL iframe unfilter plugin recommended initially in this thread by William Bowles)
P.S. I might add, this problem only occurred for me in posts/pages not when using it within sidebars – i.e. adds from Amazon.com are <iframe>, and this has never been a problem using different themes and in some cases posts/pages prior to trying a new theme in the past week.
Therefore, I would use the filter plugin to avoid problems when having multiple WP sites with different themes.
- The topic ‘Problems with the iframe tag and the WP editor’ is closed to new replies.