diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index e422c2b24bc585..305c32f9d5d7df 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -691,26 +691,6 @@ _Returns_ - `?WPBlockDisplayInformation`: Block's display information, or `null` when the block or its type not found. -### useBlockDisplayTitle - -Returns the block's configured title as a string, or empty if the title -cannot be determined. - -_Usage_ - -```js -useBlockDisplayTitle( 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1', 17 ); -``` - -_Parameters_ - -- _clientId_ `string`: Client ID of block. -- _maximumLength_ `number|undefined`: The maximum length that the block title string may be before truncated. - -_Returns_ - -- `?string`: Block title. - ### useBlockEditContext The `useBlockEditContext` hook provides information about the block this hook is being used in. diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index b7aba6e4679fa1..03f69740775f29 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -120,7 +120,7 @@ export { export { default as BlockSettingsMenu } from './block-settings-menu'; export { default as BlockSettingsMenuControls } from './block-settings-menu-controls'; export { default as BlockTitle } from './block-title'; -export { default as useBlockDisplayTitle } from './block-title/use-block-display-title'; +export { default as __experimentalUseBlockDisplayTitle } from './block-title/use-block-display-title'; export { default as BlockToolbar } from './block-toolbar'; export { default as BlockTools } from './block-tools'; export { diff --git a/packages/block-library/src/template-part/edit/index.js b/packages/block-library/src/template-part/edit/index.js index 20137abd54b5cc..6a01720ef927e4 100644 --- a/packages/block-library/src/template-part/edit/index.js +++ b/packages/block-library/src/template-part/edit/index.js @@ -10,9 +10,9 @@ import { useSelect } from '@wordpress/data'; import { BlockSettingsMenuControls, useBlockProps, - useBlockDisplayTitle, Warning, store as blockEditorStore, + __experimentalUseBlockDisplayTitle as useBlockDisplayTitle, __experimentalUseNoRecursiveRenders as useNoRecursiveRenders, __experimentalUseBlockOverlayActive as useBlockOverlayActive, } from '@wordpress/block-editor'; @@ -82,7 +82,7 @@ export default function TemplatePartEdit( { }, [ templatePartId, clientId ] ); - const blockTitle = useBlockDisplayTitle( clientId, 25 ); + const blockTitle = useBlockDisplayTitle( { clientId, maximumLength: 25 } ); const { templateParts } = useAlternativeTemplateParts( area, templatePartId