Skip to content

Commit

Permalink
Page List: Prevent users from adding inner blocks to Page List (#46269)
Browse files Browse the repository at this point in the history
* 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 Dec 2, 2022
1 parent 25dccb4 commit f4dfa32
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 f4dfa32

Please sign in to comment.