WordPress.org

Make WordPress Core

Changeset 23745


Ignore:
Timestamp:
03/18/2013 08:40:39 PM (5 years ago)
Author:
azaozz
Message:

Editor: preserve the textarea content when saving, wpautop is not used and TinyMCE is hidden. Props WraithKenny, fixes #23743

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js

    r23153 r23745  
    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
     221                if ( ed.isHidden() )
     222                    o.content = o.element.value;
     223                else if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' )
     224                    o.content = switchEditors.pre_wpautop(o.content);
    226225            });
    227226
Note: See TracChangeset for help on using the changeset viewer.