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

git-svn-id: http://core.svn.wordpress.org/trunk@24747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-07-19 00:22:22 +00:00
parent c1dbc01850
commit 4c17aa3707

View File

@ -524,11 +524,12 @@ wp.autosave.local = {
init: function( settings ) {
var self = this;
// Run only on the Add/Edit Post screens and in browsers that have sessionStorage
if ( 'post' != window.pagenow || ! this.checkStorage() )
// Check if the browser supports sessionStorage and editor.js is loaded
if ( ! this.checkStorage() || typeof switchEditors == 'undefined' )
return;
// editor.js has to be loaded before autosave.js
if ( typeof switchEditors == 'undefined' )
// Don't run if the post type supports neither 'editor' (textarea#content) nor 'excerpt'.
if ( ! $('#content').length && ! $('#excerpt').length )
return;
if ( settings )