How to add a tooltip for MediaReplaceFlow from @wordpress/block-editor
How to add a tooltip for MediaReplaceFlow from @wordpress/block-editor
How to add a tooltip for MediaReplaceFlow from @wordpress/block-editor
Custom Link Block with own background color
How to dynamically add style tags to Gutenberg editor in react
Thanks to Toms reply I took a closer look again with fresh eyes and saw that I wrote columns: ‘2’ instead of columns: 2. I also added the linkTo: ‘media’ attribute and rearranged the code to follow documentation (passing BlockProps to innerBlocksProps – I edited the original code post to reflect that).
Is it possible to add custom Components in the InspectorControls to the new “Styles” Tab?
Your selectors are wrong. { attributes: { link1: { type: ‘string’, source: ‘attribute’, attribute: ‘href’, selector: ‘.btn-afil-text-card a:first-child’ }, link2: { type: ‘string’, source: ‘attribute’, attribute: ‘href’, selector: ‘.btn-afil-text-card a:last-child’ } }, } Both of your a elements are the first (and last) children of their parents, which means that your attributes are each getting … Read more
It appears this is a known issue with the block editor (aka Gutenberg). That Trac ticket suggests a workaround, too: replace your if ( ! is_admin() ) { … } with something like this: global $current_screen; if ( ( ! is_admin() ) && ( ! ( // Checks the value of WP_Screen::is_block_editor(). $current_screen instanceof \WP_Screen … Read more
The section titled Live rendering in the block editor on the WordPress documentation page, Creating dynamic blocks, has sample code demonstrating how to use server-side rendering. The documentation page says: Gutenberg 2.8 added the <ServerSideRender> block which enables rendering to take place on the server using PHP rather than in JavaScript. Rather than setting edit: … Read more
It sounds like the issue might be related to the way WordPress loads parent and child themes, and how it handles functions that are defined in both. When a child theme is active, WordPress loads the functions.php file from the child theme first, and then loads the parent theme’s functions.php file. If there is a … Read more
Block to show posts from same category