Remove or disable Appearance > Patterns
This works for me: // Remove WP Block add_action(‘admin_init’, ‘remove_wp_block_menu’, 100); function remove_wp_block_menu() { remove_submenu_page( ‘themes.php’, ‘edit.php?post_type=wp_block’ ); }
This works for me: // Remove WP Block add_action(‘admin_init’, ‘remove_wp_block_menu’, 100); function remove_wp_block_menu() { remove_submenu_page( ‘themes.php’, ‘edit.php?post_type=wp_block’ ); }
Adding block style dependencies
You have to watch editor changes, you can hook the js to ‘enqueue_block_editor_assets’. your-child-theme/js/default-open-in-new-tab.js wp.domReady(() => { //console.log(“Custom script loaded”); const { subscribe } = wp.data; //we want to subscribe to changes of the editor // Helper function to determine if a URL is external const isExternalLink = (url) => { try { const domain … Read more
Add/remove capability for blocks theme nav menu
Block Editor: Filter getSaveElement and innerBlocks
In what way is the Tag Cloud block different? That block is a dynamic block, which uses a live rendering using ServerSideRender, and the documentation stated that “If you pass attributes to ServerSideRender, the block must also be registered and have its attributes defined in PHP“, therefore, custom attributes for the block must be defined … Read more
I want to know if there’s a way to use subscribe so that when a pattern is added I can run something It’d be easy to do that if we had something like getPatterns() which would behave similar to getBlocks(), and/or if an inserted pattern (which could contain one or more blocks) had a comment … Read more
They’re defined the same way they always have been, in a CSS file. Do what styling you can using the block editor and theme.json then supplement it with additional CSS in a CSS file. You can enqueue it the same was as a classic theme in functions.php, and if it’s a minor change there’s a … Read more
By setting the attributes that the variation is looking for. When you register a variation you’re also telling WordPress what attributes determine if a block is that variation. Figuring It Out From The Editor If we insert every variation of the group block and copy those blocks: Then paste them into a text editor ( … Read more
If it’s a menu item in a classic menu, then yes, you could use useEntityProp to get and set the menu item’s post meta, except that the post type is actually nav_menu_item and that you would need to manually add custom fields support to that post type. const navMenuItemId = 123; const [ meta, setMeta … Read more