Last active
August 2, 2020 06:30
-
-
Save vanaf1979/33e3202d0c7dc7b1fad140d647292524 to your computer and use it in GitHub Desktop.
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
it is giving the error "Uncaught SyntaxError: Cannot use import statement outside a module". Any ideas?