WordPress.org

Make WordPress Core

Changeset 23745


Ignore:
Timestamp:
03/18/13 20:40:39 (13 months 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.