Customise “Add a New Post” page
Customise “Add a New Post” page
Customise “Add a New Post” page
Gutenberg Dev – React Context.Provider returns undefined
Add custom block to submenu variation
Restrict Block from having a Parent or Ancenstor Block
So, if I want to add any custom styles or scripts in a block’s CSS or JS file, I usually add them in the PHP file associated with the block (the render property in block.json). Add the following code to the PHP file at the end – $beautiful_option = get_option(‘beautiful’); wp_add_inline_script(‘some-script’, ‘const BEAUTIFUL_OPTION=’ .$beautiful_option, ‘before’); … Read more
Block Theme : Query Loop with attachments
You’ll have to define the settings on theme.json. Here are the documentation links that would be of help. https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/ https://developer.wordpress.org/themes/advanced-topics/theme-json/
When developing a block with @wordpress/scripts, wp-scripts uses @wordpress/dependency-extraction-webpack-plugin to allow you to import dependencies from WordPress by replacing the import statements with references to the global variables loaded by the enqueued scripts. For example, this: import { useEffect } from ‘@wordpress/element’ Will become: const { useEffect } = wp.element; And wp-element will be added … Read more
I was able to achieve the functionality I desired by simply using the scrollIntoView API documented here to scroll the selected slide into view after my slider adjusted its position.
Yes, you’re right that the slimImageObject function is the reason why you’re seeing/getting only those limited list of props. But don’t worry, you can use wp.data.select( ‘core’ ).getMedia( <attachment id> ) to get the attribution meta (and any other meta or props in the full attachment object). Here’s an example that worked for me: items.map((item, … Read more