Skip to content

Commit

Permalink
Fix site editor isFeatureActive deprecation (#49545)
Browse files Browse the repository at this point in the history
- Use correct store name
- Add @deprecated to jsdoc block
  • Loading branch information
talldan authored Apr 3, 2023
1 parent c60c26c commit 6c41347
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/reference-guides/data/data-core-edit-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ _Returns_

### isFeatureActive

> **Deprecated**
Returns whether the given feature is enabled or not.

_Parameters_
Expand Down
3 changes: 2 additions & 1 deletion packages/edit-site/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ export const __unstableGetPreference = createRegistrySelector(
/**
* Returns whether the given feature is enabled or not.
*
* @deprecated
* @param {Object} state Global application state.
* @param {string} featureName Feature slug.
*
* @return {boolean} Is active.
*/
export function isFeatureActive( state, featureName ) {
deprecated( `select( 'core/interface' ).isFeatureActive`, {
deprecated( `select( 'core/edit-site' ).isFeatureActive`, {
since: '6.0',
alternative: `select( 'core/preferences' ).get`,
} );
Expand Down

1 comment on commit 6c41347

@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 6c41347.
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/4593111001
📝 Reported issues:

Please sign in to comment.