Make WordPress Core

Opened 16 years ago

Closed 15 years ago

#16526 closed defect (bug) (worksforme)

Switching from "HTML" to "Visual" view when creating/adding a post deletes some of the code

Reported by: farinha Owned by:
Priority: normal Milestone:
Component: Editor Version: 3.0.5
Severity: normal Keywords:
Cc: Focuses:

Description

Trying to use Vimeo's embed code in a post. When I add the code in the "HTML" view of a post and hit "Preview", the code works with no problem. But if I switch to "Visual" view (to write the rest of the post, the iframe part of the code gets removed, and so the video no longer appears in the post. Here's the Vimeo embed code:

<iframe src="http://player.vimeo.com/video/19723907" width="540" height="304" frameborder="0"></iframe><p><a href="http://vimeo.com/19723907">Moullinex - Catalina</a> from <a href="http://vimeo.com/moullinex">Moullinex</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

And after switching from "HTML" to "Visual" and then back to "HTML":

<a href="http://vimeo.com/19723907">Moullinex - Catalina</a> from <a href="http://vimeo.com/moullinex">Moullinex</a> on <a href="http://vimeo.com">Vimeo</a>.

Attachments (1)

16526.diff (1.3 KB ) - added by garyc40 16 years ago.
Allow iframe in tinymce

Download all attachments as: .zip

Change History (11)

#1 follow-up: @nacin
16 years ago

Do you have the unfiltered HTML capability? (Editor or administrator, or if multisite, super admin.)

#2 @duck_
16 years ago

I can reproduce as administrator user, so seems like something else going on for iframes.

Sidenote you can use the inbuilt oEmbed functionality to embed videos from vimeo (and other providers).

#3 in reply to: ↑ 1 @linuxologos
16 years ago

Replying to nacin:

Do you have the unfiltered HTML capability? (Editor or administrator, or if multisite, super admin.)

I don't think it's a matter of unfiltered HTML. Iframes have been working just like farinha reports since I use WordPress (around 2.5). I haven't even thought it is a bug. :)

@garyc40
16 years ago

Allow iframe in tinymce

#4 @garyc40
16 years ago

See: Google Maps iframe Deleted with TinyMCE and Advanced TinyMCE

The patch I attached addresses this. But I'm not sure whether this is plugin material? tiny_mce_before_init is made for this.

#5 @garyc40
16 years ago

  • Keywords has-patch needs-testing added

#6 @kawauso
16 years ago

  • Cc otterish@… added

#7 follow-up: @theBrettman
15 years ago

  • Version 3.0.53.1

I am trying to paste the iFrame into a page and having the same issue in wordpress 3.1.

According to this: http://en.support.wordpress.com/google-maps/, it's supposed to turn the iframe into shortcode after you publish, draft, or update but it's obviously not working in wordpress 3.1. That's odd because that post is from March 3rd so it should work, right? Well, it's not working for me, unfortunately.

#8 in reply to: ↑ 7 @garyc40
15 years ago

Replying to theBrettman:

I am trying to paste the iFrame into a page and having the same issue in wordpress 3.1.

theBrettman, please don't change the version number. It's there to track when a bug was introduced / reported.

Also, could you try 16526.diff to see if it works for you? It needs some testing.

Side note: we need to disable this Version dropdown for non-committers.

#9 @azaozz
15 years ago

  • Keywords reporter-feedback added; has-patch needs-testing removed
  • Version 3.13.0.5

The visual editor doesn't support iframes by default as they are very rarely used (this enhances security for most users too). If you want to use iframes, please make the patch into a plugin.

@theBrettman are you talking about wordpress.com or a self-hosted installation?

#10 @ocean90
15 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review
  • Resolutionworksforme
  • Status newclosed

Since WordPress 3.2 the editor supports iframes – the code from above works.

See #17086.

Note: See TracTickets for help on using tickets.