WordPress.org

Make WordPress Core

Ticket #23743: 23743.diff

File 23743.diff, 1.2 KB (added by WraithKenny, 3 months ago)
  • wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js

     .../js/tinymce/plugins/wordpress/editor_plugin_src.js       | 13 +++++++------
     1 file changed, 7 insertions(+), 6 deletions(-)
    
    diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
    index 9fecbc4..ae95cbe 100644
    a b  
    217217                        }); 
    218218 
    219219                        ed.onSaveContent.add(function(ed, o) { 
    220                                 if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' ) { 
    221                                         if ( ed.isHidden() ) 
    222                                                 o.content = o.element.value; 
    223                                         else 
    224                                                 o.content = switchEditors.pre_wpautop(o.content); 
    225                                 } 
     220                                // If editor is hidden, we just want the textarea's value to be saved, not the TinyMCE's content. 
     221                                if ( ed.isHidden() ) 
     222                                        o.content = o.element.value; 
     223                                // If editor is not hidden, and 'wpautop' == true, we want to unautop the TinyMCE's content. 
     224                                else if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' ) 
     225                                        o.content = switchEditors.pre_wpautop(o.content); 
     226                                // Otherwise leave it alone... 
    226227                        }); 
    227228 
    228229                        /* disable for now