[wp-trac] [WordPress Trac] #32513: Disabling WYSIWYG tab via the wp_editor_settings filter breaks the editor if it contains a textarea tag

WordPress Trac noreply at wordpress.org
Thu Jun 4 19:15:39 UTC 2015


#32513: Disabling WYSIWYG tab via the wp_editor_settings filter breaks the editor
if it contains a textarea tag
--------------------------+------------------------------
 Reporter:  andruxnet     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  4.2.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  administration
--------------------------+------------------------------

Comment (by andruxnet):

 Right, that's what's happening.

 In my case I fixed it by using a second filter like below, so the fix I
 was thinking was to run esc_textarea() through the editor content all the
 time - not sure if this would affect anything else, though.


 {{{
 function wp_editor_escape_textarea( $content ) {
         global $post;

         if ( get_post_type( $post ) === 'form' ) {
                 return esc_textarea( $content );
         }

         return $content;
 }
 add_filter( 'the_editor_content', 'wp_editor_escape_textarea' );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32513#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list