Skip to content

Commit

Permalink
Add notes about edit-site
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Dec 28, 2023
1 parent fe82b70 commit 93f63a2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/reference-guides/slotfills/plugin-more-menu-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This slot will add a new item to the More Tools & Options section.

Note: In the site editor, import `PluginMoreMenuItem` from `@wordpress/edit-site` instead.

## Example

```js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
This slot allows the creation of a `<PluginSidebar>` with a menu item that when clicked will expand the sidebar to the appropriate Plugin section.
This is done by setting the `target` on `<PluginSidebarMoreMenuItem>` to match the `name` on the `<PluginSidebar>`

Note: In the site editor, import `PluginSidebar` and `PluginSidebarMoreMenuItem` from `@wordpress/edit-site` instead.

## Example

```js
Expand Down
2 changes: 2 additions & 0 deletions docs/reference-guides/slotfills/plugin-sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
This slot allows for adding items into the Gutenberg Toolbar.
Using this slot will add an icon to the bar that, when clicked, will open a sidebar with the content of the items wrapped in the `<PluginSidebar />` component.

Note: In the site editor, import `PluginSidebar` from `@wordpress/edit-site` instead.

## Example

```js
Expand Down
3 changes: 3 additions & 0 deletions packages/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ _Usage_
// Using ES5 syntax
var el = React.createElement;
var Fragment = wp.element.Fragment;
// In the site editor, import PluginSidebar and PluginSidebarMoreMenuItem from wp.editSite instead.
var PluginSidebar = wp.editPost.PluginSidebar;
var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
var registerPlugin = wp.plugins.registerPlugin;
Expand Down Expand Up @@ -123,6 +124,8 @@ registerPlugin( 'plugin-name', {

```js
// Using ESNext syntax

// In the site editor, import PluginSidebar and PluginSidebarMoreMenuItem from @wordpress/edit-site instead.
import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
import { registerPlugin } from '@wordpress/plugins';
import { more } from '@wordpress/icons';
Expand Down
3 changes: 3 additions & 0 deletions packages/plugins/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const plugins = {} as Record< string, WPPlugin >;
* // Using ES5 syntax
* var el = React.createElement;
* var Fragment = wp.element.Fragment;
* // In the site editor, import PluginSidebar and PluginSidebarMoreMenuItem from wp.editSite instead.
* var PluginSidebar = wp.editPost.PluginSidebar;
* var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
* var registerPlugin = wp.plugins.registerPlugin;
Expand Down Expand Up @@ -94,6 +95,8 @@ const plugins = {} as Record< string, WPPlugin >;
* @example
* ```js
* // Using ESNext syntax
*
* // In the site editor, import PluginSidebar and PluginSidebarMoreMenuItem from @wordpress/edit-site instead.
* import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
* import { registerPlugin } from '@wordpress/plugins';
* import { more } from '@wordpress/icons';
Expand Down

0 comments on commit 93f63a2

Please sign in to comment.