Overriding pasting text into WordPress (1 post)

  1. midimid
    Posted 3 years ago #

    I'm currently scripting a custom theme and want to have control over pasting text into the wordpress post editor.

    The issue is concerning pasting in code and using the pre element. If I switch to the "Text" tab when editing a post, paste in code (i.e. an entire html page) and wrap pre tags around it, everything works fine. But when I switch back to the Visual tab and save, WordPress edits the text and the output becomes unusable.

    I would like to somehow take control of this so that I can easily paste in large sets of HTML, javascript, and CSS code, have it all wrapped in a single pre tag (so that spaces and tabs are formatted correctly) and I would prefer to do this in a way where it is all included as part of a template.

    Is that possible?

Topic Closed

This topic has been closed to new replies.

About this Topic