Forums

[resolved] Protecting Embed Codes From Breaking in the Visual Editor (11 posts)

  1. golddave
    Member
    Posted 2 years ago #

    I'm having problems with a blog where a writer is embedding objects (audio, video) using the HTML editor but his boss is using the Visual editor and keeps messing up the embed codes. Disabling the Visual editor may not be an option. Is there a way to protect embed codes from being munged in the Visual editor?

  2. Jonas Grumby
    Member
    Posted 2 years ago #

    Nope. How about making the boss' role one that does not let him edit other people's content (like maybe Author)?

  3. golddave
    Member
    Posted 2 years ago #

    That wouldn't work since his actual position title is Editor. It's his job to edit the posts.

  4. Jonas Grumby
    Member
    Posted 2 years ago #

    How about if you give him a good external editor, disable Visual mode, and let him paste his content in?

  5. golddave
    Member
    Posted 2 years ago #

    We can't disable Visual mode. We may just have to train people to not use Visual mode if there are embeds.

  6. Jonas Grumby
    Member
    Posted 2 years ago #

    You can also save your embed codes in an external document so that after they break them in Visual mode they can paste them back in.

  7. golddave
    Member
    Posted 2 years ago #

    Would it be possible to escape embed codes by using a shortcode?

  8. Jonas Grumby
    Member
    Posted 2 years ago #

    Actually you could probably come up with a way to put the embed codes in an external file and do an include.

  9. Jonas Grumby
    Member
    Posted 2 years ago #

    I wonder if WP would eat this code;

    <script src="whatever.js" type="text/javascript"> </script>

  10. golddave
    Member
    Posted 2 years ago #

    Can't do that. We're not dealing with technical people so we have to keep their involvement as simple as possible. Once we start asking them to copy code somewhere else and reference it here we're asking them to do too much.

  11. Jonas Grumby
    Member
    Posted 2 years ago #

    I was thinking that whoever adds the code does that in HTML mode and anyone who edits the post or page after that does so in Visual mode, as long as WP will not strip out the code.

Topic Closed

This topic has been closed to new replies.

About this Topic