Skip to content

Instantly share code, notes, and snippets.

@pattyok
Created March 16, 2020 22:06
Show Gist options
  • Save pattyok/1ae353ec801cd8c9b5daf52b51afb4c3 to your computer and use it in GitHub Desktop.
Save pattyok/1ae353ec801cd8c9b5daf52b51afb4c3 to your computer and use it in GitHub Desktop.
New Block
import edit from './edit';
import { registerBlockType } from '@wordpress/blocks';
import {__} from '@wordpress/i18n';
registerBlockType("mytheme-blocks/firstblock", {
title: __("First Block", "mytheme-blocks"),
description: __("Our first block", "mytheme-blocks"),
category: "layout",
icon: "admin-network",
keywords: [__("photo", "mytheme-blocks"), __("image", "mytheme-blocks")],
edit: edit,
save: function() {
return el("p", null, "Saved content");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment