From 2a7fe02f87025d9dcecfe9e5a8814da403ed6540 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Fri, 15 Oct 2021 16:39:10 +0400 Subject: [PATCH] Cover: Add 'templateLock' attribute --- packages/block-library/src/cover/block.json | 3 +++ packages/block-library/src/cover/edit.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/packages/block-library/src/cover/block.json b/packages/block-library/src/cover/block.json index ab967afd2b67b..1acb31d663e62 100644 --- a/packages/block-library/src/cover/block.json +++ b/packages/block-library/src/cover/block.json @@ -62,6 +62,9 @@ "isDark": { "type": "boolean", "default": true + }, + "templateLock": { + "enum": [ "all", "insert", false ] } }, "supports": { diff --git a/packages/block-library/src/cover/edit.js b/packages/block-library/src/cover/edit.js index bcb34a81e24d1..9db6bed9f9fa4 100644 --- a/packages/block-library/src/cover/edit.js +++ b/packages/block-library/src/cover/edit.js @@ -325,6 +325,7 @@ function CoverEdit( { style: styleAttribute, url, alt, + templateLock, } = attributes; const { gradientClass, @@ -616,6 +617,7 @@ function CoverEdit( { className: 'wp-block-cover__inner-container', }, { + templateLock, template: innerBlocksTemplate, templateInsertUpdatesSelection: true, }