Skip to content

Editor Script: Add back compat with WP 6.5 #1760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/changelog/1760-from-description
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fixed

Fixes a bug in WordPress 6.5 where the plugin settings in the Editor would fail to render, due to a backwards compatibility break.
2 changes: 1 addition & 1 deletion build/editor-plugin/plugin.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '1bd009e5ff8d85217279');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '35ef322601ad7ccf1214');
2 changes: 1 addition & 1 deletion build/editor-plugin/plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@wordpress/core-data": "^7.22.0",
"@wordpress/data": "^10.0.0",
"@wordpress/dom-ready": "^4.0.0",
"@wordpress/edit-post": "^8.22.0",
"@wordpress/editor": "^14.22.0",
"@wordpress/element": "^6.0.0",
"@wordpress/env": "^10.10.0",
Expand Down
12 changes: 10 additions & 2 deletions src/editor-plugin/plugin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PluginDocumentSettingPanel, PluginPreviewMenuItem } from '@wordpress/editor';
import { PluginDocumentSettingPanel as DocumentSettingPanel } from '@wordpress/edit-post';
import { registerPlugin } from '@wordpress/plugins';
import { TextControl, RadioControl, RangeControl, __experimentalText as Text, Tooltip } from '@wordpress/components';
import { Icon, globe, people, external } from '@wordpress/icons';
Expand Down Expand Up @@ -34,6 +35,7 @@ const EditorPlugin = () => {
if ( 'wp_block' === postType ) {
return null;
}

const { maxImageAttachments = 4 } = useOptions();
const labelStyling = {
verticalAlign: 'middle',
Expand Down Expand Up @@ -61,8 +63,14 @@ const EditorPlugin = () => {
</Tooltip>
);

/*
* Backwards compatibility with WordPress 6.5.
* @todo Remove when 6.5 is no longer supported.
*/
const SettingsPanel = PluginDocumentSettingPanel || DocumentSettingPanel;

return (
<PluginDocumentSettingPanel
<SettingsPanel
name="activitypub"
className="block-editor-block-inspector"
title={ __( 'Fediverse ⁂', 'activitypub' ) }
Expand Down Expand Up @@ -139,7 +147,7 @@ const EditorPlugin = () => {
} }
className="activitypub-visibility"
/>
</PluginDocumentSettingPanel>
</SettingsPanel>
);
};

Expand Down
Loading