diff --git a/packages/block-library/src/query/block.json b/packages/block-library/src/query/block.json index 1de605c652b02..fc557abee646e 100644 --- a/packages/block-library/src/query/block.json +++ b/packages/block-library/src/query/block.json @@ -36,9 +36,6 @@ "query": "query", "layout": "layout" }, - "usesContext": [ - "postId" - ], "supports": { "html": false }, diff --git a/packages/block-library/src/query/edit/index.js b/packages/block-library/src/query/edit/index.js index 5d6b59c033e2a..8ca57e39e5268 100644 --- a/packages/block-library/src/query/edit/index.js +++ b/packages/block-library/src/query/edit/index.js @@ -21,11 +21,7 @@ import QueryBlockSetup from './query-block-setup'; import { DEFAULTS_POSTS_PER_PAGE } from '../constants'; const TEMPLATE = [ [ 'core/query-loop' ] ]; -export function QueryContent( { - attributes, - context: { postId }, - setAttributes, -} ) { +export function QueryContent( { attributes, setAttributes } ) { const { queryId, query, layout } = attributes; const instanceId = useInstanceId( QueryContent ); const blockProps = useBlockProps(); @@ -42,16 +38,13 @@ export function QueryContent( { // would cause to overide previous wanted changes. useEffect( () => { const newQuery = {}; - if ( postId && ! query.exclude?.length ) { - newQuery.exclude = [ postId ]; - } if ( ! query.perPage && postsPerPage ) { newQuery.perPage = postsPerPage; } if ( !! Object.keys( newQuery ).length ) { updateQuery( newQuery ); } - }, [ query.perPage, query.exclude, query.inherit, postId ] ); + }, [ query.perPage, query.inherit ] ); // We need this for multi-query block pagination. // Query parameters for each block are scoped to their ID. useEffect( () => {