Replace multiple RichText components in a single block – wp.blockEditor.RichText multiline prop is deprecated

Now I can’t replace these with InnerBlocks as Innerblocks can only be used once in a block A HTML tag has this same restriction yet it hasn’t stopped this from being done, the answer is composition. The core/columns block has this same problem and solves it by only allowing individual core/column blocks as its children, … Read more

How do I add text or message above the featured image area in gutenberg for a CPT

Try this: function wrapPostFeaturedImage( OriginalComponent ) { const currentPostType = wp.data.select( ‘core/editor’ ).getCurrentPostType(); // Do nothing, if the post type is not rt_brands. if ( ‘rt_brands’ !== currentPostType ) { return OriginalComponent; } return function( props ) { // Your code here. }; } You can also: Conditionally add your filter: // Check if the … Read more

How do I load css in edit screens for the block builder?

To load a custom stylesheet for the WordPress admin screens that manage posts and use the block editor, you can use the admin_enqueue_scripts hook to enqueue your stylesheet. Here’s an example of how you can achieve this: First, create a custom stylesheet (let’s call it admin-custom-styles.css) and place it in your theme or plugin directory. … Read more

No aspect ratio selector in a custom block

Per the developer handbook: This value signals that a block supports some of the CSS style properties related to dimensions. When it does, the block editor will show UI controls for the user to set their values if the theme declares support. So in your theme you’ll need to declare support either by setting appearanceTools … Read more

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