Skip to content

Commit 4731aff

Browse files
committed
Editor: Remove hardcoded autosave conditions for templates
1 parent cd4fae7 commit 4731aff

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

packages/editor/src/store/actions.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,6 @@ export const autosave =
462462
async ( { select, dispatch } ) => {
463463
const post = select.getCurrentPost();
464464

465-
// Currently template autosaving is not supported.
466-
if ( post.type === 'wp_template' ) {
467-
return;
468-
}
469-
470465
if ( local ) {
471466
const isPostNew = select.isEditedPostNew();
472467
const title = select.getEditedPostAttribute( 'title' );

packages/editor/src/store/selectors.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,6 @@ export const getAutosaveAttribute = createRegistrySelector(
389389
}
390390

391391
const postType = getCurrentPostType( state );
392-
393-
// Currently template autosaving is not supported.
394-
if ( postType === 'wp_template' ) {
395-
return false;
396-
}
397-
398392
const postId = getCurrentPostId( state );
399393
const currentUserId = select( coreStore ).getCurrentUser()?.id;
400394
const autosave = select( coreStore ).getAutosave(
@@ -616,12 +610,7 @@ export const isEditedPostAutosaveable = createRegistrySelector(
616610
const postType = getCurrentPostType( state );
617611
const postTypeObject = select( coreStore ).getPostType( postType );
618612

619-
// Currently template autosaving is not supported.
620-
// @todo: Remove hardcode check for template after bumping required WP version to 6.8.
621-
if (
622-
postType === 'wp_template' ||
623-
! postTypeObject?.supports?.autosave
624-
) {
613+
if ( ! postTypeObject?.supports?.autosave ) {
625614
return false;
626615
}
627616

0 commit comments

Comments
 (0)