Block: attributes not saving

I figured it out. For anyone else this is how i did it. my save function ends with return el(‘div’, {}, el( ‘p’, {className: ‘paragraphs’}, attributes.paragraphs ), ) and i changed my attribute to this. paragraphs: { type: ‘string’, default: 1, source: ‘html’, selector: ‘.paragraphs’, }, Then in my style.scss i just have a display:none. … Read more

Saving data from block editor to the database

I’ve found a solution using Ajax with native Javascript as follows: // Filename send2server.js const sendToServer = function() { /* Prepare the object to be sent: ********************************************************************/ var params = new FormData(); params.append(‘action’, ‘update_sql’); // update_sql is implemented in PHP (see below) params.append(‘quoteAtt’, props.attributes.quoteAtt); // The actual data /* Create the Ajax connection object: ****************************************************************/ … Read more