-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds simple primary term block for demo
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"apiVersion": 3, | ||
"name": "example/primary-category", | ||
"title": "Post Primary Category", | ||
"icon": "archive", | ||
"category": "common", | ||
"example": {}, | ||
"supports": { | ||
"html": false | ||
}, | ||
"attributes": {}, | ||
"variations": [], | ||
"editorScript": "file:./index.ts" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { useBlockProps } from '@wordpress/block-editor'; | ||
import { PostPrimaryCategory } from '@10up/block-components'; | ||
|
||
export const BlockEdit = ({context}) => { | ||
const blockProps = useBlockProps(); | ||
return ( | ||
<div {...blockProps}> | ||
<PostPrimaryCategory /> | ||
</div> | ||
) | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { registerBlockType } from '@wordpress/blocks'; | ||
import metadata from './block.json'; | ||
import { BlockEdit } from './edit'; | ||
|
||
|
||
registerBlockType( metadata, { | ||
edit: BlockEdit, | ||
save: () => null | ||
}); |