The Developer’s Guide to WordPress 6.8

WordPress 6.8 introduces powerful updates for plugin and theme developers—dive into the latest APIs, design tools, and performance features.

Apr 16, 2025 - 18:15
 0
The Developer’s Guide to WordPress 6.8

WordPress 6.8, codenamed “Cecil,” includes loads of goodies for developers to tinker with. As usual, I’m like an overwhelmed toddler in a toy shop, just trying to figure out which toy I want to take for a test spin first.

The 6.8 update touched many areas of the WordPress Core code, including everything from the block library to performance to patterns. Plus, there are plenty of other quality-of-life improvements in 6.8 for anyone building plugins and themes. 

Without further ado, let’s jump straight into them.

For detailed information on each development change, check out the official WordPress 6.8 Field Guide on the Make WordPress Core blog.

  1. More performant block type registration
  2. Style Book sections and more
  3. Block Library updates
    1. New block: Query Total
    2. Gallery lightbox
    3. Details block
    4. Nice-to-have feature additions
    5. Notable block CSS changes
  4. Design tools extended to more blocks
  5. Organizing patterns
    1. Add patterns to subfolders 
    2. Starter patterns category
  6. API updates
    1. Interactivity
    2. Block Hooks
  7. Security: switched to bcrypt for password hashing
  8. Performance improvements
    1. Speculative loading
    2. useSelect performance warning
    3. Filter hook for loading block assets on demand
  9. What will you build with WordPress 6.8?

More performant block type registration

WordPress 6.8 eliminates the need to manually register block types thanks to its new wp_register_block_types_from_metadata_collection() function. It is a wrapper for the blocks-manifest.php file and the wp_register_block_metadata_collection() function introduced in WordPress 6.7. 

Because all of the block data is stored as PHP in blocks-manifest.php, you can register all of your plugin’s block types without reading individual JSON files. Overall, it’s just a more efficient way to register block types—and yes, you can use it for registering single block types, too!

In WordPress 6.8, you can register all of your block types with this call:

wp_register_block_types_from_metadata_collection(
    __DIR__ . '/build',
    __DIR__ . '/build/blocks-manifest.php'
);

Read the developer note on the Make WordPress Core blog for more information or to find out how to use this in a backward-compatible way when supporting older versions of WordPress.

Style Book sections and more

The Typography Style Book page on WordPress showing typesets on the left and heading stylings on the right

One of the biggest improvements in 6.8 is the interface update to the Style Book, which separates your style settings into sections. Shown in the screenshot above, you can see how selecting a typeset makes it easier to test and preview your site’s typography.

There are also a couple of other notable upgrades to the Style Book. It now has its own route, which lets you link directly to it. The new URL path is /wp-admin/site-editor.php?p=%2Fstyles&preview=stylebook. Additionally, Style Book support was added for classic themes.

Block Library updates

Between new blocks and additional ways to use existing blocks, WordPress 6.8 brings useful enhancements to the Block Library that expand what you can build and how you build it. 

New block: Query Total

Orange boxes highlighting total results and range display from the Query Total block in WordPress

WordPress 6.8 ships a new block for sharing information to visitors about the current posts query: Query Total. It should be used inside an existing Query Loop block and has two display options:

  • Total results, which displays the total number of query results found.
  • Range display, which shows the current results you’re looking at in the total results range.

Gallery lightbox

An orange box highlighting the expand on click setting in WordPress

WordPress 6.8 brings the lightbox effect to the Gallery block. The feature is the same as it already works for individual Image blocks. You set the lightbox effect at the Gallery level by clicking on the Link button in the toolbar and selecting the Enlarge on click option.

It’s worth noting that this feature does not create a lightbox slideshow where you can scroll through all images for the Gallery; it merely applies the existing lightbox feature to the individual Image blocks.

Details block

a heading and description in a WordPress details block

You can now group multiple Details blocks together via the name HTML attribute. When multiple

elements share the same name, browsers will automatically close an open element when another is opened, creating an accordion effect. You can set the name attribute under Advanced → Name Attribute in the block inspector sidebar.

The Details block also gained HTML anchor support in WordPress 6.8. It is located under Advanced → HTML Anchor.

Nice-to-have feature additions

WordPress 6.8 boasts smaller feature additions to several other blocks, including:

Notable block CSS changes

WordPress 6.8 includes a couple of CSS-related changes that are unlikely to break theme designs, but they are worth noting as general improvements:

  • The Buttons block now has box-sizing: border-box applied, which brings consistency with other blocks.
  • The Image block’s overlay styles are now handled via a data-wp-bind--style directive rather than an inline

    Questo sito utilizza i cookie. Continuando a navigare nel sito, accetti il nostro utilizzo dei cookie.