From 74446e747ebcb46f6515630c2a8c392e9286440a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Thu, 7 Mar 2024 17:49:40 +0100 Subject: [PATCH] Fix template & parts custom filtering --- .../src/components/page-templates-template-parts/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/edit-site/src/components/page-templates-template-parts/index.js b/packages/edit-site/src/components/page-templates-template-parts/index.js index 6410f3498283f9..08742bd724c3d5 100644 --- a/packages/edit-site/src/components/page-templates-template-parts/index.js +++ b/packages/edit-site/src/components/page-templates-template-parts/index.js @@ -379,7 +379,7 @@ export default function PageTemplatesTemplateParts( { postType } ) { if ( filter.field === 'author' && filter.operator === OPERATOR_IN && - !! filter.value + filter?.value?.length > 0 ) { filteredData = filteredData.filter( ( item ) => { return filter.value.includes( item.author_text ); @@ -387,7 +387,7 @@ export default function PageTemplatesTemplateParts( { postType } ) { } else if ( filter.field === 'author' && filter.operator === OPERATOR_NOT_IN && - !! filter.value + filter?.value?.length > 0 ) { filteredData = filteredData.filter( ( item ) => { return ! filter.value.includes( item.author_text );