Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Show nested terms toggle when inheriting
  • Loading branch information
mikachan committed Oct 21, 2025
commit 3f1e1a7cf24a0d64b64f84c4b7c537a288e7b858
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export default function TermsQueryInspectorControls( {
templateSlug?.startsWith( 'taxonomy-' ) ||
templateSlug?.startsWith( 'category-' ) ||
templateSlug?.startsWith( 'tag-' );
// Only display the showNested control if the taxonomy is hierarchical and not inheriting.
const displayShowNestedControl = isTaxonomyHierarchical && ! inheritQuery;
// Display the showNested control if the taxonomy is hierarchical.
const displayShowNestedControl = isTaxonomyHierarchical;
const hasIncludeFilter = !! include?.length;

// Labels shared between ToolsPanelItem and its child control.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ export default function InheritControl( { value, onChange, label } ) {
onChange={ ( newValue ) => {
onChange( {
inherit: newValue === 'default',
// When enabling inherit, hierarchical is not supported.
...( newValue === 'default' ? { showNested: false } : {} ),
} );
} }
help={
value
? __(
'Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows direct children of the current term. For non-hierarchical taxonomies, shows all terms.'
'Display terms based on the current taxonomy archive. For hierarchical taxonomies, you can choose to show nested terms or only direct children.'
)
: __( 'Display terms based on specific criteria.' )
}
Expand Down