Introduction to WordPress SlotFill
In 2019, I was lucky enough to speak at the fantastic JavaScript for WordPress conference. It was my first virtual conference and I had a really great time. It's a…
In 2019, I was lucky enough to speak at the fantastic JavaScript for WordPress conference. It was my first virtual conference and I had a really great time. It's a…
InnerBlocks have no built-in way to limit the number of blocks allowed inside them. Let's use the renderAppender prop to achieve this.
A couple of years ago, I created a Twitter bot that tweets out WordPress core trac tickets marked as GoodFirstBugs to help new contributors find a good starting place. It…
Now that the PluginDocumentSettingPanel
is in WordPress core, we can add our own panels to the Document Settings panel using the registerPlugin
function.
const { registerPlugin } = wp.plugins;
const { PluginDocumentSettingPanel } = wp.editPost;
const MyCustomSideBarPanel = () => (
<PluginDocumentSettingPanel
name="my-custom-panel"
title="My Custom Panel"
>
Hello, World!
</PluginDocumentSettingPanel>
);
registerPlugin( 'my-custom-panel', {render: MyCustomSideBarPanel } );
The above code will insert a new Panel in the Document Sidebar with the title of “My Custom Panel ” and will display “Hello, World!” as it’s content. If we want this panel to appear on every post type registered, then we’re done but what if we want to restrict this panel to just a single post type?
(more…)