Skip to content

Commit

Permalink
Page List: Prevent users from adding inner blocks to Page List (WordP…
Browse files Browse the repository at this point in the history
…ress#46269)

* Page List: Allow only the page-list-item block, and disable the inserter and drag and drop

* Also lock the page list item blocks
  • Loading branch information
scruffian authored and mpkelly committed Dec 7, 2022
1 parent 3cd54f5 commit 28191a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/block-library/src/page-list/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ export default function PageListEdit( {
parentPageID,
] );

const innerBlocksProps = useInnerBlocksProps( blockProps );
const innerBlocksProps = useInnerBlocksProps( blockProps, {
allowedBlocks: [ 'core/page-list-item' ],
renderAppender: false,
__unstableDisableDropZone: true,
templateLock: 'all',
} );

const getBlockContent = () => {
if ( ! hasResolvedPages ) {
Expand Down

0 comments on commit 28191a7

Please sign in to comment.