Patterns in WP after 6.3

Patterns now come in two types: synced and unsynced

What we used to know as reusable blocks are now called synced patterns, but they behave in almost the same fashion:

  • The synced pattern is editable, and once it is edited all instances of the pattern will reflect any changes made.
  • Any synced pattern can be “detached” meaning that it can be disassociated from its parent and individually edited.
  • There is a known URL to reach the pattern editor which can be found at several places.

#1 Via the “three dot” menu when editing a page or post

#2 The link at the bottom of the synced pattern tab of the block inserter

#3 At a known, but for some reason unlinked area of the site backend:

(root URL)/wp-admin/edit.php?post_type=wp_block

Now when you create a new pattern you have the option to select whether the pattern will be synced or unsynced:

It is important to note that this is now a choice that cannot be reversed and the core developers of WordPress have done this deliberately – you can still detach an instance of a synced pattern in a page or post but you cannot take a synced pattern and change it into an unsynced pattern.

When you create an unsynced pattern it will also be found at (root URL)/wp-admin/edit.php?post_type=wp_block

In the array you will not be able to tell if a pattern is synced or unsysnced:

But when you open the pattern it will be noted:

Up until now patterns could only be added via a theme, a plugin, or via core … now unsynced patterns can be edited and stored in the database.

If you are using a FSE theme you will see this in the site editor

The “my patterns” group is unlocked and editable (whereas the patterns that come from core, the theme, or plugins are locked).

If you are not using a FSE theme then access to this editorial function is available, but convoluted (see above).

Using this block of code in your functions file will add a link in the left admin sidebar to take you directly to that location

add_action( 'admin_menu', 'register_custom_menu_link' );
function register_custom_menu_link(){
    add_menu_page( 'custom menu link', 'Patterns', 'manage_options', 'any-url', 'pdog_custom_menu_link', 'dashicons-layout', 35 ); 
}

function pdog_custom_menu_link(){
    wp_redirect( '/wp-admin/edit.php?post_type=wp_block', 301 ); 
	exit;
}

Another issue is that in FSE themes there is no longer any path to the customizer and some plugins (WooCommerce for instance) still have controls that you would want to access…. thankfully this is another known URL.

I have wrapped both of these additions in a little plugin which you can download below: