From 5b4da51acb5de5d2f337a6e8c76189f20745bf60 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Sun, 2 Oct 2022 16:51:15 +0400 Subject: [PATCH] Query Loop: Fix condition for displaying 'parents' control The logical NOT here is a typo. The Query Loop block should display the filter for hierarchical post types; unless the `allowedControls` list omits the control filter. --- .../block-library/src/query/edit/inspector-controls/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/block-library/src/query/edit/inspector-controls/index.js b/packages/block-library/src/query/edit/inspector-controls/index.js index 2900debcd16b3..225299123c642 100644 --- a/packages/block-library/src/query/edit/inspector-controls/index.js +++ b/packages/block-library/src/query/edit/inspector-controls/index.js @@ -237,10 +237,7 @@ export default function QueryInspectorControls( { ) } { isPostTypeHierarchical && - ! isControlAllowed( - allowedControls, - 'parents' - ) && ( + isControlAllowed( allowedControls, 'parents' ) && ( !! parents?.length } label={ __( 'Parents' ) }