From 9e7699033d1ec43a0c6ec59247d51c5a2e548678 Mon Sep 17 00:00:00 2001 From: gabriel-glo Date: Thu, 25 Jul 2024 14:29:39 +0200 Subject: [PATCH 1/2] Update import statement in CreatePodcastShowModal component --- assets/js/create-podcast-show.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/create-podcast-show.js b/assets/js/create-podcast-show.js index c54c3db..a728d3e 100644 --- a/assets/js/create-podcast-show.js +++ b/assets/js/create-podcast-show.js @@ -1,5 +1,5 @@ import { registerPlugin } from "@wordpress/plugins"; -import { PluginDocumentSettingPanel, store as editPostStore } from '@wordpress/edit-post'; +import { PluginDocumentSettingPanel, store as editPostStore } from '@wordpress/editor'; import { __ } from "@wordpress/i18n"; import { Button, From 631e951d693e8ebfe0ca1fd32e094663d1912c19 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Tue, 20 Aug 2024 16:22:54 -0600 Subject: [PATCH 2/2] Support both WordPress 6.6+ and 6.5- in loading the proper editor component --- assets/js/create-podcast-show.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/js/create-podcast-show.js b/assets/js/create-podcast-show.js index a728d3e..6c7fdfd 100644 --- a/assets/js/create-podcast-show.js +++ b/assets/js/create-podcast-show.js @@ -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, @@ -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;