Skip to content

Commit

Permalink
Fix version in useSetting deprecation notice (#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.'
);
} );
} );

1 comment on commit e95bb8c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in e95bb8c.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6944013746
📝 Reported issues:

Please sign in to comment.