Skip to content

Commit

Permalink
update to use the default 'editor.BlockEdit' filter
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Sep 25, 2020
1 parent b58bca4 commit 0b11e9d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ export default function useNavigationBlockWithName( { menuId } ) {
const { saveMenu } = useDispatch( 'core' );

removeFilter(
'navigation.BlockEdit',
'editor.BlockEdit',
'core/edit-navigation/with-menu-name'
);

const withMenuName = createHigherOrderComponent(
( BlockEdit ) => ( props ) => {
if ( props.name !== 'core/navigation' ) {
return <BlockEdit { ...props } />;
}
return (
<>
<BlockEdit { ...props } />
Expand All @@ -50,7 +53,7 @@ export default function useNavigationBlockWithName( { menuId } ) {
);

addFilter(
'navigation.BlockEdit',
'editor.BlockEdit',
'core/edit-navigation/with-menu-name',
withMenuName
);
Expand Down

0 comments on commit 0b11e9d

Please sign in to comment.