useBlockProps() nests wrapper with class name inside block wrapper in the editor

I was bitten by this as well, and it caused me much frustration. I had exactly the same nested block duplication problem that you described above. I was able to solve this issue by specifying an apiVersion for my custom block. E.g.: registerBlockType(“custom-cafe-theme/custom-column”,{ apiVersion: 2, // or 3 title: “Custom Column”, attributes: { imgID: { … Read more

Gutenberg Static blocks: viewScript doesn’t import css for frontend?

I didn’t declare the viewStyle for frontend and thus the css wasn’t being enqueued. { “viewStyle”: [ “file:./view.css”, “example-view-style” ] } build/view.css had all the needed css for swiper – it just wasn’t being declared with viewStyle https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-style . view.css: /*!*******************************************************************************************************************************************************************************************!*\ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/swiper/swiper-bundle.css ***! \*******************************************************************************************************************************************************************************************/ /** * Swiper 11.0.7 * Most modern mobile touch … Read more

How to I serve the static HTML file at the root directory in a wordpress site?

I needed the same thing – a ‘landing’ page at the root site that was custom-built (via PHP), but then WordPress-based pages elsewhere. I did it with the htaccess file for the site: # For example.com root, set landing.php as the default page RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC] RewriteRule ^$ /landing.php [L] This will redirect www.example.com … Read more

How to build BOTH non-block components and blocks present in the /src directory using @wordpress/scripts

I’m pasting the answer I got from a developer in the Gutenberg repository. Just add a webpack.config.js file at the root of your project with the following contents: const defaultConfig = require( ‘@wordpress/scripts/config/webpack.config’ ); module.exports = { …defaultConfig, entry: { …defaultConfig.entry(), index: ‘./src/index.js’, }, }; This will build all the blocks in /src/blocks/ folder and … Read more

Detecting whenever a user types – in the Gutenberg editor, and checking if there is a preceding or succeeding – then converting both to an em dash

I managed to find an answer to this. Instead of adding an event listener to the editor, I hooked some additional functionality onto Gutenberg’s Autocompleter instead: I wrote a post here detailing how I did this, if anyone is looking to do the same thing: https://blog.terresquall.com/2023/06/how-i-made-double-dashes-automatically-convert-to-em-dashes-in-wordpress-gutenberg-editor/

techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduseduedusedueduseduedueduedus