Skip to content
Merged
Changes from all commits
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
Query Pagination: Pass allowedBlocks as constant
  • Loading branch information
Mamaduka committed Sep 9, 2022
commit 822e171585cf87e167f49c36f0d9230650f58304
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