From 13f82c3c52011239966463f6b5653cf9ba35b3f3 Mon Sep 17 00:00:00 2001 From: Mario Santos Date: Fri, 24 May 2024 17:37:30 +0200 Subject: [PATCH] Disable editing in templates --- packages/editor/src/bindings/post-meta.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/bindings/post-meta.js b/packages/editor/src/bindings/post-meta.js index 22529db8ba7cf..8ed3295f56600 100644 --- a/packages/editor/src/bindings/post-meta.js +++ b/packages/editor/src/bindings/post-meta.js @@ -42,7 +42,10 @@ export default { ? context.postType : select( editorStore ).getCurrentPostType(); - // TODO: Check that editing is happening in the post editor and not a template. + // Check that editing is happening in the post editor and not a template. + if ( postType === 'wp_template' ) { + return true; + } // Check that the custom field is not protected and available in the REST API. const isFieldExposed =