This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Product Categories List: Add show child categories only toggle (#9550)
* Add show child categories only toggle to Product Categories block * Check if current page is a template editor before adding the toggle * Show current category if show_children is enabled and its the last category in the hierarchy * Update comment * Fix typo * Remove forward slash * Add is-widget-editor utility and enable feature for block usage in widget editor * Don't render anything if the child only option is enabled and there are no children
- Loading branch information
1 parent
4bb57c1
commit bc46f4e
Showing
5 changed files
with
104 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { isObject } from '../types/type-guards'; | ||
|
||
export const isWidgetEditorPage = ( store: unknown ): boolean => { | ||
if ( isObject( store ) ) { | ||
const widgetAreas = ( | ||
store as { | ||
getWidgetAreas: () => string; | ||
} | ||
).getWidgetAreas(); | ||
|
||
return Array.isArray( widgetAreas ) && widgetAreas.length > 0; | ||
} | ||
|
||
return false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters