Make WordPress Core

Changeset 24747


Ignore:
Timestamp:
07/19/2013 12:22:22 AM (11 years ago)
Author:
nacin
Message:

Post type support for local autosaves. props azaozz. see #24756.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/autosave.js

    r24743 r24747  
    525525        var self = this;
    526526
    527         // Run only on the Add/Edit Post screens and in browsers that have sessionStorage
    528         if ( 'post' != window.pagenow || ! this.checkStorage() )
    529             return;
    530         // editor.js has to be loaded before autosave.js
    531         if ( typeof switchEditors == 'undefined' )
     527        // Check if the browser supports sessionStorage and editor.js is loaded
     528        if ( ! this.checkStorage() || typeof switchEditors == 'undefined' )
     529            return;
     530
     531        // Don't run if the post type supports neither 'editor' (textarea#content) nor 'excerpt'.
     532        if ( ! $('#content').length && ! $('#excerpt').length )
    532533            return;
    533534
Note: See TracChangeset for help on using the changeset viewer.