Multiple checkboxes Gutenberg control

Use this code $.each(data, function (c, fields) { checkboxes.push( el( CheckboxControl, { key: fields.value, label: fields.label, name: ‘myCheckbox[]’, checked: props.attributes.myCheckbox.indexOf(fields.value) > -1, onChange: function( val ) { let data = props.attributes.myCheckbox; if (val) { if (data.indexOf(fields.value) === -1) { data.push(fields.value); } } else { data = props.attributes.myCheckbox.filter((v) => v !== fields.value); } props.setAttributes({ myCheckbox: data … Read more

Component toggle not toggling

I used this toggler to add a class to an element if checked. Maybe your goal is the same with a class for a larger font. I used it like this: checked: !!textSize, onChange: function(){ textSize ? props.setAttributes({ textSize: ” }) : props.setAttributes({ textSize: ‘ big’ }) } So textSize controls the checked status and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)