From 0803a8113a779d2b3c073a83a0ece827bb5bcca3 Mon Sep 17 00:00:00 2001 From: Sarah Norris <1645628+mikachan@users.noreply.github.com> Date: Sat, 12 Oct 2024 07:31:38 +0100 Subject: [PATCH] Query Loop: Fix isControlAllowed and isTemplate combined logic (#65984) * Fix isControlAllowed and isTemplate logic * Remove isTemplate check when inherit is already being checked Co-authored-by: mikachan Co-authored-by: t-hamano Co-authored-by: fabiankaegy Co-authored-by: ndiego Co-authored-by: daviedR --- .../src/query/edit/inspector-controls/index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 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 28a6113620fb7c..b373e0933fe718 100644 --- a/packages/block-library/src/query/edit/inspector-controls/index.js +++ b/packages/block-library/src/query/edit/inspector-controls/index.js @@ -123,21 +123,18 @@ export default function QueryInspectorControls( props ) { const showInheritControl = isTemplate && isControlAllowed( allowedControls, 'inherit' ); const showPostTypeControl = - ( ! inherit && isControlAllowed( allowedControls, 'postType' ) ) || - ! isTemplate; + ! inherit && isControlAllowed( allowedControls, 'postType' ); const postTypeControlLabel = __( 'Post type' ); const postTypeControlHelp = __( 'Select the type of content to display: posts, pages, or custom post types.' ); const showColumnsControl = false; const showOrderControl = - ( ! inherit && isControlAllowed( allowedControls, 'order' ) ) || - ! isTemplate; + ! inherit && isControlAllowed( allowedControls, 'order' ); const showStickyControl = - ( ! inherit && - showSticky && - isControlAllowed( allowedControls, 'sticky' ) ) || - ( showSticky && ! isTemplate ); + ! inherit && + showSticky && + isControlAllowed( allowedControls, 'sticky' ); const showSettingsPanel = showInheritControl || showPostTypeControl ||