Run the edit function of parent block when something changes in InnerBlocks
Run the edit function of parent block when something changes in InnerBlocks
Run the edit function of parent block when something changes in InnerBlocks
It seems I’ll have to answer my question myself 🙂 The solution that I found is using uncontrolled form input component (substituting <TextControl>, or more precisely, I opted to use __experimentalInputControl, with prop isPressEnterToChange={ true }, which only updates control on pressing Enter. I did not inspect the code, but I believe firmly that it … Read more
Share reusable blocks between network sites
Is there a better way to to make async API calls using the @wordpress/data module?
It’s possible to use the language_attributes filter as before since the template canvas in FSE contains: <html <?php language_attributes(); ?>> Add this code to the appropriate place in your theme or plugin: <?php add_filter( ‘language_attributes’, function($lang_attributes) { return “$lang_attributes foo=\”bar\””; });
From the docs: While it is possible to return a string value from save, it will be escaped. If the string includes HTML markup, the markup will be shown on the front of the site verbatim, not as the equivalent HTML node content. If you must return raw HTML from save, use wp.element.RawHTML. As the … Read more
I’m not the most experienced in block themes, but from what I’ve seen of them so far I feel pretty confident in saying that the functionality you describe should be implemented as a block. But it’s wrong to say that absolutely everything needs to be HTML and JS. There is still a place for PHP. … Read more
I’m wondering if I can use any of the functions listed in the @wordpress/date package to convert a GMT date to a date in the user’s locale. Yes, you can use the dateI18n() function. However, the source date (i.e. the 2nd parameter for the above function) by default uses the time zone of the user’s … Read more
I see that you do not use register_block_type in PHP, which is now recommended way to register block. I am assuming you register block in the front-end ( I am not familiar with create-block ), and instead that I inspect create-block, would you share your front end code where you also have translation functions? It … Read more
Controlling the RichText component outside of blocks