Blocks
Hier findest du alles rund um das Theme Blocks
Blocks registrieren
// Importiere deine Variable / Komponenten
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
registerBlockType( 'blockarchive/blockname', {
title: __('Blockname'),
description: 'Block Beschreibung.',
category: 'category',
icon: {
background: '#deinefarbe',
foreground: '#deinefarbe',
src: 'Dashicon',
},
keywords: [
__( 'Suchetag 1' ),
__( 'Suchetag 2' ),
__( 'Suchetag 3' )
],
supports: {
html: false,
align: true
},
attributes: {
deineAttr: {
type: 'string'
}
}
edit: () => {
return(
<h2>Mein Backend<h2>
)
},
save: ( props ) => {
return(
<h2>Mein Frontend<h2>
)
}
});Last updated
Was this helpful?