Skip to content

Commit

Permalink
Fix version in useSetting deprecation notice (WordPress#56377)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy authored Nov 21, 2023
1 parent 3e42c03 commit e95bb8c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ _Parameters_

### useSetting

> **Deprecated** 6.4.0 Use useSettings instead.
> **Deprecated** 6.5.0 Use useSettings instead.
Hook that retrieves the given setting for the block instance in use.

Expand Down
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/use-settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@ export function useSettings( ...paths ) {
*
* @param {string} path The path to the setting.
* @return {any} Returns the value defined for the setting.
* @deprecated 6.4.0 Use useSettings instead.
* @deprecated 6.5.0 Use useSettings instead.
* @example
* ```js
* const isEnabled = useSetting( 'typography.dropCap' );
* ```
*/
export function useSetting( path ) {
deprecated( 'wp.blockEditor.useSetting', {
since: '6.4',
since: '6.5',
alternative: 'wp.blockEditor.useSettings',
note: 'The new useSettings function can retrieve multiple settings at once, with better performance.',
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe( 'useSettings', () => {
const result = runHook( () => useSetting( 'layout.contentSize' ) );
expect( result ).toBe( '840px' );
expect( console ).toHaveWarnedWith(
'wp.blockEditor.useSetting is deprecated since version 6.4. Please use wp.blockEditor.useSettings instead.'
'wp.blockEditor.useSetting is deprecated since version 6.5. Please use wp.blockEditor.useSettings instead.'
);
} );
} );

0 comments on commit e95bb8c

Please sign in to comment.