Skip to content

Instantly share code, notes, and snippets.

@vanaf1979 vanaf1979/icon-block.js
Last active Feb 16, 2020

Embed
What would you like to do?
Gist for my article: WordPress: Adding custom svg icons to your Gutenberg blocks/plugin. https://since1979.dev/wordpress-adding-custom-svg-icons-to-your-gutenberg-blocks-plugin/
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
import icons from './icons/icons.js'
registerBlockType("va79/blockname", {
title: __("Blockname"),
icon: icons.github, // The Block icon
category: "layout",
keywords: [__("Blockname")],
attributes: {
...
},
edit: ( { attributes, className, isSelected, setAttributes } ) => {
...
},
save: props => {
...
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.