Compare commits
2 Commits
18542739f7
...
334332a64f
Author | SHA1 | Date |
---|---|---|
Ray Elliott | 334332a64f | |
Ray Elliott | 3b24fcf36e |
12
src/index.js
12
src/index.js
|
@ -4,9 +4,13 @@ import './editor.scss';
|
||||||
import { registerBlockType } from '@wordpress/blocks';
|
import { registerBlockType } from '@wordpress/blocks';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
const NAMESPACE = '';
|
||||||
|
const SLUG = '';
|
||||||
|
const BLOCK_TITLE= '';
|
||||||
|
|
||||||
registerBlockType( '<NAMESPACE>/<SLUG>', { // FIXME replace <NAMESPACE>, <SLUG>, <BLOCK TITLE>
|
|
||||||
title: __( '<BLOCK TITLE>', '<SLUG>' ), // FIXME replace <BLOCK TITLE> ,<SLUG>
|
registerBlockType( `${NAMESPACE}/${SLUG}`, {
|
||||||
|
title: __( BLOCK_TITLE, SLUG),
|
||||||
|
|
||||||
category: 'widgets',
|
category: 'widgets',
|
||||||
|
|
||||||
|
@ -20,14 +24,14 @@ registerBlockType( '<NAMESPACE>/<SLUG>', { // FIXME replace <NAMESPACE>, <SLU
|
||||||
type: 'string',
|
type: 'string',
|
||||||
source: 'text',
|
source: 'text',
|
||||||
selector: 'p'
|
selector: 'p'
|
||||||
default: __('A default name', '<NAMESPACE>'), // FIXME replace <NAMESPACE>
|
default: __('A default name', NAMESPACE),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
edit( { attributes, className } ) {
|
edit( { attributes, className } ) {
|
||||||
return (
|
return (
|
||||||
<p className={ className }>
|
<p className={ className }>
|
||||||
{ attributes.name }
|
{ attributes.name }
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue