From b51aabf170cb2f34c008db9941cac17b64fb7a9a Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Tue, 23 Nov 2021 19:22:31 +0800 Subject: [PATCH] Template Part: Kebab case the title (#36764) --- .../block-library/src/template-part/edit/placeholder/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/template-part/edit/placeholder/index.js b/packages/block-library/src/template-part/edit/placeholder/index.js index cb405fb283f127..64a730535c0f5b 100644 --- a/packages/block-library/src/template-part/edit/placeholder/index.js +++ b/packages/block-library/src/template-part/edit/placeholder/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { find } from 'lodash'; +import { find, kebabCase } from 'lodash'; /** * WordPress dependencies @@ -65,7 +65,7 @@ export default function TemplatePartPlaceholder( { // block attributes. const record = { title, - slug: 'template-part', + slug: kebabCase( title ), content: serialize( startingBlocks ), // `area` is filterable on the server and defaults to `UNCATEGORIZED` // if provided value is not allowed.