From 712f3acea7672d6b78d799918fd9b3dbe3184b1c Mon Sep 17 00:00:00 2001 From: Mario Santos Date: Fri, 17 May 2024 12:23:49 +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 160b460bea2a2d..28931acb899908 100644 --- a/packages/editor/src/bindings/post-meta.js +++ b/packages/editor/src/bindings/post-meta.js @@ -45,7 +45,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 =