Skip to content
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

Update plugin-document-setting-panel.md bad import reference #61651

Closed
wants to merge 1 commit into from

Conversation

andersrehn
Copy link

What?

Fix reference error found in documentation on PluginDocumentSettingPanel

Why?

When you follow the code examples you get non-compiling code as PluginDocumentSettingPanel is undefined when using the editor library instead of edit-post

How?

Updates the documentation to use the correct library where PluginDocumentSettingPanel can be found

Changes imports from @wordpress/editor to @wordpress/edit-post

Testing Instructions

Tested on WP 6.5.3
Built with node packages:
@wordpress/scripts 27.8.0
@wordpress/components 27.5.0

Create a simple WP Block and use the demo code. Compile using npm run build. Include the block or built JavaScript, there should be no undefined PluginDocumentSettingPanel now.

import { registerPlugin } from '@wordpress/plugins';
import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
const PluginDocumentSettingPanelDemo = () => (
    <PluginDocumentSettingPanel
        name="lime-custom-panel"
        title="Custom Panel"
        className="lime-custom-panel"
    >
        Custom Panel Contents
    </PluginDocumentSettingPanel>
);

registerPlugin('plugin-document-setting-panel-demo', {
    render: PluginDocumentSettingPanelDemo,
    icon: 'palmtree',
});

Testing Instructions for Keyboard

N/A

Screenshots or screencast

Fix reference error found on https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/

Previously mention to import from @wordpress/editor PluginDocumentSettingPanel. The module is not present in that package but rather @wordpress/edit-post. 

Tested on WP 6.5.3
Built with node packages: 
@wordpress/scripts 27.8.0
@wordpress/components 27.5.0
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @andersrehn.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: andersrehn.


To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label May 14, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @andersrehn! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@youknowriad
Copy link
Contributor

Thanks for opening this PR, I understand that it's confusing at the moment but there's actually no issues because the documentation in "trunk" matches the code in "trunk" which will land in WordPress in 6.6.

That said, we still need to see how to pin the live site to 6.5 instead. See #61657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants