Crafting Web Experiences
Lists all blocks from block editor wp.data.select( ‘core/block-editor’ ).getBlocks(); wp.data.select( ‘core/block-editor’).getBlockRootClientId( clientId ) Get Parent Block Client Id Set attributes wp.data.dispatch(“core/block-editor”).updateBlockAttributes(“block_client_id”, {attr}); Get root block client id: (e.g when you are extending the query-loop) wp.data.select(“core/block-editor”).getBlockRootClientId( clientId_child_block ); Get featured image $featuredImageId = wp.data.select(“core/editor”).getEditedPostAttribute(“featured_media”); Get current post type wp.data.select(“core/editor”).getCurrentPostType(); Execute on DOM ready wp.domReady(function () {} ); …
https://developer.wordpress.org/refere…uery_vars Frontend: Editor: JS: Note: When defining the code on the server side, changes are not reactive in the block editor. To achieve an immediate effect, I recommend using Gutenberg’s built-in methods (see link), inside a useEffect.
In case you can’t add in your Web Server, then you can use as PHP. For the CSP, you can generate using the Chrome extension: CSP Generator.
You can relocate the wp-content folder by defining these constants in wp-config.php before the require_once line that loads wp-settings.php: What each constant does: Checklist before switching:
There’s an issue with Support Board plugin and Litespeed plugin. The widget won’t show on the frontend! The reason is that litespeed is minifying a core js file of the support board plugin. To fix this, you need to add wp-content/plugins/supportboard/supportboard/js/main.js to Litespeed Cache > Page Optimization > [8] Tunning > JS Excludes.