Removing unnecessary CSS and JS code from wp_head()
Removing unnecessary CSS and JS code from wp_head()
Removing unnecessary CSS and JS code from wp_head()
Currently that is not an option inside the block editor. You need to add custom CSS to do it.
Assuming that your search block is inside the group block, you need to set the attribute via $processor->set_attribute( ‘data-wp-interactive’, ‘wpse/local-search’ ); inside your wpse_locals_filter_search function as well, since inner blocks are processed before the outer blocks (see line 11 below): function wpse_locals_filter_search( $block_content, $block ) { if ( isset( $block[‘attrs’][‘className’] ) && ‘wpse-local-filter’ === $block[‘attrs’][‘className’] … Read more
As of now, there is no dedicated user capability to read a reusable block; it is not possible to customize the capabilities (reading, editing, deleting) exclusively for reusable blocks. The capabilities are currently tied into in the capabilities of the post type ‘post’ so the capabilities that you give to the post type ‘post’ will … Read more
You’re getting that notice because your JavaScript code resulted in the following error: ReferenceError: Cannot access ‘EditComponent’ before initialization This means you need to register your block after the constants EditComponent and SaveComponent are defined. // Define the constants first. const EditComponent = …; const SaveComponent = …; // Then register your block. registerBlockType(‘eternaltwentyfifteen/prevnext’, { … Read more
Make sure the layout.css file is called correctly, both on the frontend and backend. No need to add fontFace, you have called it via @import : { “$schema”: “https://schemas.wp.org/trunk/theme.json”, “version”: 3, “settings”: { “layout”: { “contentSize”: “700px”, “wideSize”: “1200px” }, “typography”: { “fontFamilies”: [ { “fontFamily”: “\”PT Sans\”, sans-serif”, “name”: “PT Sans”, “slug”: “pt-sans” }, … Read more
I know I can do it by adding a CSS class under ‘Advanced’ but it’s not ideal for non-technical content editors. That sounds exactly like a block style, which is essentially the GUI version of this. You can assign a block style from the block inspectors style tab, the toolbar, or the inserter, and it … Read more
First: It is impossible allowedBlocks only accepts block names as strings — not specific variations or object definitions. Second: What’s the correct approach? Use the base block name, then define the variation via className or attributes in the template. How to find a variation’s className? Insert the block (e.g., core/group) and select the desired variation. … Read more
In Site Editor (I’m using latest WordPress 6.7.2) Open the Document Overview (staggered 3 bar icon, Shift-Alt-O) Note: This is “Edit Site” not “Edit Page” on the top bar, or left menu Appearance, Editor. Header is actually a “template part”, you can have multiple headers and multiple footers, and each template can use 0 or … Read more
This won’t work as you expect it, PHP is intended for server rendered blocks, it isn’t aware of the editor context unless it’s told the context. But to do that you need to read it in and pass it to the component on the JS side, and then read it in again on the PHP … Read more