const wp = window.wp; const { InnerBlocks } = wp.blockEditor; const { TextControl } = wp.components; wp.blocks.registerBlockType( 'ads/linkwrapper', { title: 'Link Wrapper', icon: { background: '#00695C', foreground:'#fff', src:'schedule' }, category: 'agendahelsinki', attributes: { linktarget:{type:'string',default:''}, }, example:()=>null, edit: function ( props ) { return (

Link Wrapper Block

Link target

{ if(props.attributes.linktarget!=newval) { props.setAttributes({linktarget:newval}); } }} />

Link Content

); }, save: function (props) { return(
{window.location=props.attributes.linktarget}} style={{'cursor':'pointer'}}> {}
); } } );