Skip to content

Conversation

@kadamwhite
Copy link
Contributor

@kadamwhite kadamwhite commented Mar 27, 2025

Description

Resolves a console warning encountered when using the current version of the plugin, encountered since this component was moved from the "editPost" to "editor" package within Gutenberg.

wp.editPost.PluginDocumentSettingPanel is deprecated since version 6.6. Please use wp.editor.PluginDocumentSettingPanel instead.

Documentation for PluginDocumentSettingPanel: https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/

Deploy Notes

Are there any new dependencies added that should be taken into account when deploying to WordPress.org?

  • None

Steps to Test

  • Activate this plugin on a WordPress 6.6.x or 6.7.x website
  • Set SCRIPT_DEBUG to true in wp-config (otherwise these warnings will not be shown)
  • Load the editor
  • Verify no deprecation notice is shown relating to this plugin's code

kadamwhite and others added 2 commits January 8, 2026 14:05
…tice in WordPress 6.6+

Resolves a console warning encountered when using the current version of the plugin, encountered since this component was moved from the "editPost" to "editor" package within Gutenberg.

> wp.editPost.PluginDocumentSettingPanel is deprecated since version 6.6. Please use wp.editor.PluginDocumentSettingPanel instead.

Documentation for PluginDocumentSettingPanel: https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/
The original change imported PluginDocumentSettingPanel from
@wordpress/editor to resolve a deprecation warning in WordPress 6.6+.
However, this component only exists in @wordpress/editor from WordPress
6.6 onwards; in WordPress 6.4-6.5 it remains in @wordpress/edit-post.

This implements a runtime fallback pattern that checks wp.editor first
(WordPress 6.6+) and falls back to wp.editPost (WordPress 6.4-6.5),
maintaining compatibility across the supported WordPress version range
whilst eliminating the deprecation warning in newer versions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@GaryJones GaryJones requested a review from a team as a code owner January 8, 2026 14:15
@GaryJones GaryJones self-assigned this Jan 8, 2026
@GaryJones GaryJones added the type: bug Something isn't working label Jan 8, 2026
@GaryJones GaryJones added this to the Next (minor) milestone Jan 8, 2026
@GaryJones GaryJones merged commit 013eeeb into Automattic:develop Jan 8, 2026
2 checks passed
@GaryJones
Copy link
Contributor

Thanks for the original fix, @kadamwhite! 🎉

Just to explain the additional commit: your change to import from @wordpress/editor was the right fix for WordPress 6.6+, but we discovered it would break compatibility with WordPress 6.4-6.5 where PluginDocumentSettingPanel only exists in @wordpress/edit-post.

Since the plugin supports WP 6.4+, we implemented a runtime fallback pattern that:

  • Uses wp.editor.PluginDocumentSettingPanel when available (WP 6.6+) — no deprecation warning
  • Falls back to wp.editPost.PluginDocumentSettingPanel (WP 6.4-6.5) — maintains compatibility

This ensures the deprecation warning is resolved for users on newer WordPress versions whilst keeping the plugin working for those still on 6.4 or 6.5.

Added a Jest test to document this requirement and prevent future regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants