Skip to content

Commit

Permalink
Support both WordPress 6.6+ and 6.5- in loading the proper editor com…
Browse files Browse the repository at this point in the history
…ponent
  • Loading branch information
dkotter committed Aug 20, 2024
1 parent 9e76990 commit 631e951
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/js/create-podcast-show.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { registerPlugin } from "@wordpress/plugins";
import { PluginDocumentSettingPanel, store as editPostStore } from '@wordpress/editor';
import { store as editPostStore } from '@wordpress/edit-post';
import { __ } from "@wordpress/i18n";
import {
Button,
Expand All @@ -15,6 +15,10 @@ import {
import { MediaUpload, MediaUploadCheck } from '@wordpress/block-editor';
import { useState, useEffect } from "@wordpress/element";
import { useSelect, dispatch } from "@wordpress/data";

// Once WordPress 6.6 becomes our minimum, change this back to `import { PluginDocumentSettingPanel } from '@wordpress/editor';`.
const PluginDocumentSettingPanel = wp.editor?.PluginDocumentSettingPanel ?? ( wp.editPost?.PluginDocumentSettingPanel ?? wp.editSite?.PluginDocumentSettingPanel );

// Due to unsupported versions of React, we're importing stores from the
// `wp` namespace instead of @wordpress NPM packages for the following.
const { store: editorStore } = wp.editor;
Expand Down

0 comments on commit 631e951

Please sign in to comment.