Skip to content

Commit

Permalink
fix (global settings): missing global settings for older wp versions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkae authored Feb 11, 2025
1 parent ef45da5 commit c068e61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/global-settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ addAction( 'stackable.global-settings.toggle-sidebar', 'toggle', () => {
} )

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

return (
<>
Expand Down

0 comments on commit c068e61

Please sign in to comment.