Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active September 22, 2019 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanaf1979/c910bc90be9879ffc06b2d1c8f8fca60 to your computer and use it in GitHub Desktop.
Save vanaf1979/c910bc90be9879ffc06b2d1c8f8fca60 to your computer and use it in GitHub Desktop.
Gist for my tutorial: Building a Gutenberg sidebar plugin Part 3: Registering with the block editor. https://vanaf1979.nl/building-a-gutenberg-sidebar-plugin-part-3-registering-with-the-block-editor/
/**
* External dependencies.
*/
import React from 'react'
/**
* WordPress dependencies.
*/
const { __ } = wp.i18n;
const { Fragment } = wp.element;
const { PluginSidebarMoreMenuItem, PluginSidebar } = wp.editPost;
/**
* Sidebar component voor the gutenberg editor.
*/
class Sidebar extends React.Component {
constructor() {
super()
}
render() {
return (
<Fragment>
<PluginSidebarMoreMenuItem target="metatags-sidebar" icon='editor-customchar'>
{__("MetaTags", "metatags")}
</PluginSidebarMoreMenuItem>
<PluginSidebar name="metatags-sidebar" title={__("MetaTags", "metatags")} >
<div className="metabox-sidebar-content">
<h3>Metatags</h3>
</div>
</PluginSidebar>
</Fragment>
)
}
}
export default Sidebar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment