Skip to content

Commit 81d4e3e

Browse files
committed
Add a apply filters to allowed blocks to enable extending
1 parent bbd3333 commit 81d4e3e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/block-library/src/social-links/edit.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
ToolbarItem,
2929
ToolbarGroup,
3030
} from '@wordpress/components';
31+
import { applyFilters } from '@wordpress/hooks';
3132
import { __ } from '@wordpress/i18n';
3233
import { check } from '@wordpress/icons';
3334

@@ -91,9 +92,15 @@ export function SocialLinksEdit( props ) {
9192
[ `items-justified-${ itemsJustification }` ]: itemsJustification,
9293
} );
9394

95+
// Filter to allow additional social link blocks
96+
const FilteredAllowedBlocks = applyFilters(
97+
'editor.SocialLinks.allowedBlocks',
98+
ALLOWED_BLOCKS
99+
);
100+
94101
const blockProps = useBlockProps( { className } );
95102
const innerBlocksProps = useInnerBlocksProps( blockProps, {
96-
allowedBlocks: ALLOWED_BLOCKS,
103+
allowedBlocks: FilteredAllowedBlocks,
97104
orientation: 'horizontal',
98105
placeholder: SocialPlaceholder,
99106
templateLock: false,

0 commit comments

Comments
 (0)