Skip to content

Commit

Permalink
Query Pagination: Pass allowedBlocks as constant (#44020)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Sep 9, 2022
1 parent a8da274 commit 6fc2d87
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/block-library/src/query-pagination/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ const TEMPLATE = [
[ 'core/query-pagination-numbers' ],
[ 'core/query-pagination-next' ],
];
const ALLOWED_BLOCKS = [
'core/query-pagination-previous',
'core/query-pagination-numbers',
'core/query-pagination-next',
];

const getDefaultBlockLayout = ( blockTypeOrName ) => {
const layoutBlockSupportConfig = getBlockSupport(
Expand Down Expand Up @@ -55,11 +60,7 @@ export default function QueryPaginationEdit( {
const blockProps = useBlockProps();
const innerBlocksProps = useInnerBlocksProps( blockProps, {
template: TEMPLATE,
allowedBlocks: [
'core/query-pagination-previous',
'core/query-pagination-numbers',
'core/query-pagination-next',
],
allowedBlocks: ALLOWED_BLOCKS,
__experimentalLayout: usedLayout,
} );
return (
Expand Down

0 comments on commit 6fc2d87

Please sign in to comment.