Skip to content

Commit c068e61

Browse files
authored
fix (global settings): missing global settings for older wp versions (#3425)
1 parent ef45da5 commit c068e61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plugins/global-settings/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ addAction( 'stackable.global-settings.toggle-sidebar', 'toggle', () => {
3535
} )
3636

3737
const GlobalSettings = () => {
38-
const PluginSidebar = window.wp.editor.PluginSidebar
38+
// For older WP versions (<6.6), wp.editor.PluginSidebar is undefined,
39+
// use wp.editSite.PluginSidebar and wp.editPost.PluginSidebar as fallback
40+
const PluginSidebar = window.wp.editor.PluginSidebar || window.wp.editSite?.PluginSidebar || window.wp.editPost?.PluginSidebar
3941

4042
return (
4143
<>

0 commit comments

Comments
 (0)