Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- edit: function ( props ) {
- var checkboxes = [];
- var data = [
- {
- label: 'Checkbox 1',
- value: 'checkbox1'
- },
- {
- label: 'Checkbox 2',
- value: 'checkbox2'
- }
- ];
- $.each( data, function ( c, fields ) {
- checkboxes.push(
- el( CheckboxControl, {
- key: fields.value,
- label: fields.label,
- checked: props.myCheckbox,
- onChange: function( val ) {
- props.setAttributes({ myCheckbox: fields.value });
- }
- })
- )
- });
- return [
- el(
- InspectorControls, {
- key: 'inspector'
- },
- el(
- PanelBody, {
- title: __( 'Settings' )
- },
- checkboxes
- )
- ),
- el( ServerSideRender, {
- block: 'block/name',
- attributes: props.attributes
- } )
- ]
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement