Prevent formatting in code editor
-
I’m looking for a code snippet or plugin recommendation, I have a customer who creates pages in WordPress and adds a paypal button, using code generated from PayPal. She goes in to text view in the WordPress wysiwyg and pastes the code, the code is of format
<form action='//paypal.com?kdjhfkjsdhf'> <input type='hidden' id=asdas'/> <input type='hidden' id=123'/> </form>So every new line is seen as a break and places lots of white space around the button. I had her remove all line breaks in the editor which removes all of the breaks, i.e.
<form action='//paypal.com?kdjhfkjsdhf'><input type='hidden' id=asdas'/><input type='hidden' id=123'/></form>However often when she goes back to the Visual view to continue editing, WordPress will remove parts of the paypal code, breaking the button, so she has to go and do it again.
I remember years ago when I had to insert php in to page content there was a plugin that let me use a shortcode to add the php, is there a html equivalent? Such as
[no-format] <form action='//paypal.com?kdjhfkjsdhf'> <input type='hidden' id=asdas'/> <input type='hidden' id=123'/> </form>[/no-format]So that she can use the Visual editor as usual but prevent WordPress from doing its thing on the paypal button code?
Thanks
The topic ‘Prevent formatting in code editor’ is closed to new replies.