Gutenberg Block Development: Trying to add custom js script to npm start command by modifying webpack.config

Thank you all for your help! I was on it since days! I found my problem: https://webpack.js.org/concepts/entry-points/ helped me to find the solution Apparently path.resolve( process.cwd(), ‘src’, ‘slider.js’ ) was not working: replacing by simple string path fixed the problem: const defaultConfig = require( ‘@wordpress/scripts/config/webpack.config’ ); module.exports = { …defaultConfig, entry: { …defaultConfig.entry, slider: ‘./src/slider.js’, … Read more

How to output child block attributes on a parent block

It’s worth a mention that storing child block attributes in the parent block’s attributes is a bit of a bizarre practice in isolation – ideally blocks should be completely independent of one-another. But if some functionality necessitates that a parent block access a child block’s attributes, it would likely have a much smaller potential for … Read more

Gutenberg Dynamic Block not Storing Attributes

You can’t use attributes that source data from the HTML markup of your block when using Dynamic Blocks. The attribute selector looks at the Save function’s HTML for the attribute, not the Edit function. You can simply use a type: ‘string’ instead. Hope this helps!

Where are the layout defaults in Twenty Twenty Two coming from?

there’s a layout option for the post content block that says it will inherit the default layout. Where is that default coming from? In block themes, the default layout settings (contentSize and wideSize) can be found in the theme.json file in the root theme folder, e.g. at wp-content/themes/twentytwentytwo/theme.json in Twenty Twenty-Two. See source on GitHub … Read more

How to use the @wordpress/date block in the Gutenberg editor?

WordPress does NOT provide date picker block by default but have date component inside core. You need to call relevant components for date picker to work. Here’s code from core Date Component import { DateTimePicker } from ‘@wordpress/components’; import { getSettings } from ‘@wordpress/date’; import { withState } from ‘@wordpress/compose’; const MyDateTimePicker = withState( { … Read more

Create RangeControl in gutenberg Block

You are creating the MySelectControl component but it is not being used inside the edit function/component. Include it there and it should appear. If you want it to appear in the settings sidebar, rather than in the editor, simply wrap the component inside the inspector-controls component (from the package @wordpress/editor): <InspectorControls> <MySelectControl /> </InspectorControls>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)