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

A page attributes panel slot now exists #61768

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

philwp
Copy link
Contributor

@philwp philwp commented May 17, 2024

What?

Adding a Slot on the Page Attributes Panel

Why?

This resolves #31888 and allows plugin authors to extend that panel with additional information.

How?

Added a new Slot PluginPageAttributesPanel which adds a new panelRow below the panel items from core. This is essentially mimicking the behavior provided by the page_attributes_misc_attributes hook.

Testing Instructions

  1. Register a plugin
const MyPageAttributes = () => {
    return (
        <PluginPageAttributesPanel className="different">
			<p>
				{ __(
					'Dude',
					'gutenberg-slot-fill-system'
				) }
			</p>
		</PluginPageAttributesPanel>
    );
}
// Register the plugin.
registerPlugin( 'my-page-attributes', { render: MyPageAttributes } );
  1. See that it appears in the page attributes panel in the editor while editing a page.

Testing Instructions for Keyboard

Screenshots or screencast

Screenshot 2024-05-17 at 11 56 28 AM

Copy link

github-actions bot commented May 17, 2024

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.

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

Co-authored-by: philwp <philwebs@git.wordpress.org>
Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>

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

@colorful-tones
Copy link
Member

"Phil's Fill" love it! 😆

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Feature] Extensibility The ability to extend blocks or the editing experience labels May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Slot to PageAttributes panel in the edit-page sidebar
3 participants