Skip to content

Commit dce58c7

Browse files
author
azaozz
committed
Prevent error in autosave for CPTs without title or editor, props sorich87, fixes #18227
git-svn-id: http://core.svn.wordpress.org/trunk@19476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent ff63a2a commit dce58c7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

wp-includes/js/autosave.dev.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,11 @@ autosave = function() {
283283
}
284284

285285
if ( fullscreen && fullscreen.settings.visible ) {
286-
post_data["post_title"] = jQuery('#wp-fullscreen-title').val();
287-
post_data["content"] = jQuery("#wp_mce_fullscreen").val();
286+
post_data["post_title"] = jQuery('#wp-fullscreen-title').val() || '';
287+
post_data["content"] = jQuery("#wp_mce_fullscreen").val() || '';
288288
} else {
289-
post_data["post_title"] = jQuery("#title").val()
290-
post_data["content"] = jQuery("#content").val();
289+
post_data["post_title"] = jQuery("#title").val() || '';
290+
post_data["content"] = jQuery("#content").val() || '';
291291
}
292292

293293
if ( jQuery('#post_name').val() )

wp-includes/js/autosave.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-includes/script-loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function wp_default_scripts( &$scripts ) {
101101
'dismiss' => __('Dismiss'),
102102
) );
103103

104-
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20111115', 1 );
104+
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20111129', 1 );
105105

106106
$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20110521', 1 );
107107

0 commit comments

Comments
 (0)