WordPress PluginSidebar, TextControl setting and saving the default value
WordPress PluginSidebar, TextControl setting and saving the default value
WordPress PluginSidebar, TextControl setting and saving the default value
The answer to my own questions is that you can’t. When you create a dynamic block you depend on the server side (PHP) entirely to generate the content and then JS can rebuild from the HTML but you cannot have this occur the other way around. So unless I create a custom table or can … Read more
Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
How to store Gutenberg ColourPicker RGBA as metadata
How to save a ToggleControl value in a meta field?
Ok, I found the solution by myself. Inside withSelect it is needed to assign default value if getEditedPostAttribute is empty. // Helper function to check if received meta object is empty or not function isEmpty(obj) { for(var key in obj) { if(obj.hasOwnProperty(key)) return false; } return true; } PhotoControl = withSelect( (select) => { let … Read more
How can I filter block registration based on post-type? (Block alignment settings)
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
Gutenberg : in the backend, I just want to store a JSON object
Cannot embed YouTube video