diff --git a/inc/meta-box.php b/inc/meta-box.php index 12a9c482..3e3a9ad4 100644 --- a/inc/meta-box.php +++ b/inc/meta-box.php @@ -104,7 +104,7 @@ protected function object_hooks() { add_action( 'edit_attachment', [ $this, 'save_post' ] ); add_action( 'add_attachment', [ $this, 'save_post' ] ); } else { - add_action( "save_post_{$post_type}", [ $this, 'save_post' ] ); + add_action( "save_post", [ $this, 'save_post' ] ); } } } diff --git a/js/autosave.js b/js/autosave.js index 55af32f2..14ceac07 100644 --- a/js/autosave.js +++ b/js/autosave.js @@ -2,7 +2,7 @@ 'use strict'; $( document ).ajaxSend( function ( event, xhr, settings ) { - if ( ! Array.isArray( settings.data ) || -1 === settings.data.indexOf( 'wp_autosave' ) ) { + if ( ( typeof settings.data !== 'string' ) || -1 === settings.data.indexOf( 'wp_autosave' ) ) { return; } var inputSelectors = 'input[class*="rwmb"], textarea[class*="rwmb"], select[class*="rwmb"], button[class*="rwmb"], input[name^="nonce_"]';