Skip to content
Prev Previous commit
Update hook to check for correct support
  • Loading branch information
getdave committed Nov 22, 2023
commit d6f968f44769180f5c57e2d590f2cb2a6f0a40cf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
import { getBlockSupport } from '@wordpress/blocks';

export default function useBlockRename( name ) {
const metaDataSupport = getBlockSupport( name, 'renaming', true );

const supportsBlockNaming = !! (
true === metaDataSupport || metaDataSupport?.name
);

return {
canRename: supportsBlockNaming,
canRename: getBlockSupport( name, 'renaming', true ),
};
}