diff --git a/packages/block-library/src/query/block.json b/packages/block-library/src/query/block.json index 6b063a41c16198..90536472ac5b91 100644 --- a/packages/block-library/src/query/block.json +++ b/packages/block-library/src/query/block.json @@ -27,6 +27,10 @@ "inherit": true } }, + "tagName": { + "type": "string", + "default": "div" + }, "layout": { "type": "object", "default": { diff --git a/packages/block-library/src/query/edit/index.js b/packages/block-library/src/query/edit/index.js index c64acc48b2f41c..3771625ea20987 100644 --- a/packages/block-library/src/query/edit/index.js +++ b/packages/block-library/src/query/edit/index.js @@ -6,11 +6,14 @@ import { useInstanceId } from '@wordpress/compose'; import { useEffect } from '@wordpress/element'; import { BlockControls, + InspectorAdvancedControls, useBlockProps, store as blockEditorStore, __experimentalUseInnerBlocksProps as useInnerBlocksProps, __experimentalBlockPatternSetup as BlockPatternSetup, } from '@wordpress/block-editor'; +import { SelectControl } from '@wordpress/components'; +import { __ } from '@wordpress/i18n'; /** * Internal dependencies @@ -22,7 +25,7 @@ import { DEFAULTS_POSTS_PER_PAGE } from '../constants'; const TEMPLATE = [ [ 'core/query-loop' ] ]; export function QueryContent( { attributes, setAttributes } ) { - const { queryId, query, layout } = attributes; + const { queryId, query, layout, tagName: TagName = 'div' } = attributes; const { __unstableMarkNextChangeAsNotPersistent } = useDispatch( blockEditorStore ); @@ -81,9 +84,24 @@ export function QueryContent( { attributes, setAttributes } ) { setLayout={ updateLayout } /> -