Auto Sizes for Lazy Loaded Images in WordPress 6.7

WordPress 6.7 adds sizes=”auto” for lazy-loaded images. This feature, which was recently added to the HTML specification, allows the  browser to use the rendered layout width of the image when selecting a source from the srcset list, since lazy loaded images don’t load until after the layout is known.

Background

Responsive image attributes, srcset and sizes were added in WordPress 4.4. Quoting the dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. from that time:

To help browsers select the best image from the source set list, we also include a default sizes attribute that is equivalent to (max-width: {{image-width}}px) 100vw, {{image-width}}px. While this default will work out of the box for a majority of sites, themes should customize the default sizes attribute as needed using the wp_calculate_image_sizes filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output..

Setting a default sizes value is important when choosing the right file to fetch from srcset, because it tells the browser what the intended layout of an image will be before the layout is known. Without any value, browsers will use the default 100vw value and assume the image is meant to fill the entire width of the viewport, resulting in many wasted bytes. The default value that has shipped with WordPress for many years ensures that the image layout is constrained by its width attribute. This helps, but in many cases is still not correct, since an image is likely layout constrained by the content width, or any blocks that they are nested within. 

Even though it is encouraged for themes to supply a more accurate sizes attribute value using the wp_calculate_image_sizes filter, doing so is challenging. Now that browsers are able to automatically apply the rendered layout to sizes for lazy-loaded images, the sizes value will be 100% correct, resulting in many fewer wasted bytes.

Implementation details

The HTML specification allows for lazy loaded images to omit sizes, explicitly set sizes=”auto”, or set sizes to a string that starts with "auto," followed by a valid source size list. In order to implement this as a progressive enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. for browsers already supporting this feature, WordPress will prepend auto to the sizes attribute of content images during wp_filter_content_tags() and any image markup generated by wp_get_attachment_image(). This will cause browsers that don’t support the new auto value to fall back to the previous sizes list.

WordPress will only add auto to the sizes value if the image includes loading=”lazy”. Otherwise, browsers that support sizes=auto will fail to validate the sizes value and apply the default value of 100vw, which will cause larger than needed images to be selected from the srcset attribute. Any custom implementations that change the loading value of images after WordPress generates the markup should use the new wp_img_tag_add_auto_sizes() function to correct the sizes attribute.

Functions added

  • wp_img_tag_add_auto_sizes – adds auto sizes to an HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. img string.
  • wp_sizes_attribute_includes_valid_auto – tests whether auto already exists on an image to ensure it’s not added more than once.

Props to @flixos90 and  @fabiankaegy for feedback and editing.

#6-7, #core, #dev-notes, #dev-notes-6-7

Let’s reconsider adopting the WP Consent API

This post is a follow up to Feature Plugin Proposal: WP Consent API from 2020, which as part of the Core Privacy Roadmap, proposed a framework to allow extenders to coordinate user consent signals and help websites honor user privacy preferences.

Objective of this proposal

The legal and moral implications around respect for user consent and tracking have evolved steadily since the original proposal was published in 2020. Powering over 40% of the web, WordPress is in a position to lead by example and provide site operators built-in and extensibleExtensible This is the ability to add additional functionality to the code. Plugins extend the WordPress core software. means to address these concerns. This proposal seeks to gather consensus around adopting the WP Consent APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. for inclusion in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress..

A brief history of the API

In early 2020, the WP Consent API feature pluginFeature Plugin A plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. was announced. It enables the setting and retrieval of user consent preferences, made accessible to plugins that register with the API. It was designed to be lean and unobtrusive, opt-in only, and with no UIUI User interface.

Rather than try to enforce cookie-setting compliance itself, the API lets opted-in plugins verify consent before placing cookies. It also allows consent categories to be defined and user choices set and stored by consent management providers (CMPs) and other extenders, where the technical and legal details around the various flavors of consent can be managed outside of WordPress.

In December 2020 the Consent API feature was swept up along with other features during a clean up of the features list, and marked as “Closed”. However, subsequent discussions in #core-privacy in following months were incognizant of the change, and there was confusion that it had been marked closed when attempts were made to move the pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party to the WordPress GitHubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ org.

Until early this year, adoption of the plugin was minimal, but has been steadily maintained by @rogierlankhorst, @szepeviktor, @xkon, @aurooba, @mujuonly, @phpgeekdk, @paapst, @aahulsebos, @pputzer, and @markwolters.

Why does this matter now?

In March 2024, enforcement of the European Union’s Digital Markets Act (DMA) began, and adoption of the plugin has since grown from under 1,000 to over 100,000 active installations. Uptake of the plugin can largely be attributed to consent-requiring plugins such as Google Site Kit, WooCommerce, and WP Statistics, which use the API to support site analytics, advertising, marketing, and tagtag A directory in Subversion. WordPress uses tags to store a single snapshot of a version (3.6, 3.6.1, etc.), the common convention of tags in version control systems. (Not to be confused with post tags.) management.


Beyond the DMA, there are numerous other privacy-focused regulations around the world that over the past few years have come into effect, or will soon. User consent is a key theme to achieving many of these protections, and WordPress can provide the foundation on which consent plugins interact.

Considerations for Core adoption

The API has remained largely unchanged since its introduction, so would likely require refreshing to meet today’s Core merge expectations. There may also be features that need to be revisited, such as how non-consent-related plugins appear in Site Health recommendations.

Along with the API, Core could implement a default cookie “popup” or blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. that could be activated similar to the built-in Privacy Policy feature. This would give site owners a simple mechanism to request and track consent (cookie-based), and be customizable without requiring an additional plugin.

A sample use would be to request “statistics” consent through the popup, styled through a theme, and wrap client-side tracking code inside a wp_has_consent() check. Extenders can take things further by expanding the default categories and storage mechanism for more advanced integrations, as current adopters of the API do today.

Canonical plugin alternative

If adding this feature to Core is not viable at this time, then another option would be to make it canonical. While originally developed under @rogierlankhorst‘s personal repo, it has since been migrated to that of a specific plugin developer and vendor in the CMP space.

Considering the original intent that this feature be merged to Core, agreement from Rogier that it remain available to the community, and the API’s adoption by other vendors, officially bringing the plugin into the WordPress org would send a clear signal to site owners and extenders that this is a community-built and supported standard.

Where to find more info

Share your thoughts

What do you think about WordPress paving the way for easier integration of consent-based privacy controls? Please comment below, especially if you have dealt with implementing consent management in WordPress.

Special thanks to @rogierlankhorst and @azaozz for review and feedback on this post.

#consent-api #core-privacy #feature-plugins #privacy #privacy-roadmap

Hallway Hangout: Performance End of Year Review 2024

Following up on the prior performance related Hallway Hangout: Performance End of Year Review 2023 in December, @flixos90 @joemcgill and @clarkeemily will be co-hosting an upcoming hallway hangout to review the work and impact of the performance team in 2024, and look ahead to performance improvements in WordPress for 2025.

If you’re interested in joining, the Hallway Hangout will happen on 2024-12-17 16:00 UTC a Google Meet link will be shared in the #core-performance SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. channel before starting.

At a high level, we will go through quick intros (what each person does/focuses on) before reviewing the major landings of the Performance team in 2024 and a look ahead to 2025.

As a reminder, hallway hangouts are meant to be casual and collaborative so come prepared with a kind, curious mind along with any questions or items you want to discuss around this important area of the project, especially since the agenda is intentionally loose to allow for it.

Noting this specifically for folks who have expressed interest previously or who are involved directly in this work cc @hellofromtonya @aristath @oandregal @annezazu @illuminea @tweetythierry @desrosj @youknowriad @dmsnell @pbearne @swissspidy @westonruter @adamsilverstein @mukesh27 @joemcgill @johnbillion @linsoftware @spacedmonkey

#core-performance, #hallwayhangout, #performance

WordPress 6.8 Call for Volunteers

As a follow-up to the release calendar proposal for 2025, let’s gather interest in being part of the release squad for the next major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope., WordPress 6.8.

Proposed WordPress 6.8 tentative schedule

Based on that calendar proposal for next year, the WordPress 6.8 tentative schedule is as follows:

MilestoneDate
Alpha (trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision. open for 6.8 release)October 22, 2024
BetaBeta A pre-release of software that is given out to a large group of users to trial under real conditions. Beta versions have gone through alpha testing in-house and are generally fairly close in look, feel and function to the final product; however, design changes often occur as part of the process. 1March 4 2025
Beta 2March 11, 2025
Beta 3March 18, 2025
Release Candidaterelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). 1March 25, 2025
Release Candidate 2April 1, 2025
Release Candidate 3April 8, 2025
Dry RunApril 14, 2025
WordPress 6.8 General ReleaseApril 15, 2025

According to the schedule above and the GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ release cadence, WordPress 6.8 would include up to Gutenberg 20.4 for a maximum of 11 releases, depending on the end-of-year Gutenberg release adjustments (according to an unaltered schedule, Gutenberg 20.0 RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). and stable would land on December 25th and January 1st, respectively).

Release Leads call for volunteers

Following the release squad structure from the last release, except for the default theme role, as WordPress 6.8 won’t deliver a new default theme, these are the minimum roles that need filling:

  • Release Coordinator(s)
  • CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Tech Lead(s)
  • Editor Tech Lead(s)
  • Core Triagetriage The act of evaluating and sorting bug reports, in order to decide priority, severity, and other factors. Lead(s)
  • Editor Triage Lead(s)
  • Documentation Lead(s)
  • Test Lead(s)
  • Design Lead(s)
  • Performance Lead(s)

It’s worth noting that WordPress 6.7 experimented with not having an explicit Marketing Lead; depending on feedback from the last release, the 6.8 squad might add back that role or other missing ones. As usual, the Release LeadRelease Lead The community member ultimately responsible for the Release. role will be filled by project leadership. Check the Core Handbook to learn more about the release team’s roles and responsibilities.

All release decisions will ultimately be this release team’s to make and communicate, while gathering input from the community, including finalizing the release schedule.

If you are interested in participating in WordPress 6.8’s release squad as a lead, please show interest in the comments below, clearly specifying your desired role, by December 6th.


Thanks to @aaroncampbell and @jeffpaul for reviewing this post.

#planning #6-8

Proposal: Major releases for 2025

With WordPress 6.7 out the door, it’s time to plan for next year’s releases. The following dates try to account for flagship events and major international holidays:

  • 6.8 – BetaBeta A pre-release of software that is given out to a large group of users to trial under real conditions. Beta versions have gone through alpha testing in-house and are generally fairly close in look, feel and function to the final product; however, design changes often occur as part of the process. 1 on March 4, stable release on April 15 (Beta 1 ten days after WC Asia)
  • 6.9 – Beta 1 on June 24, stable release on August 5 (WCEU in early June)
  • 7.0 – Beta 1 on  September 30, stable release on November 11 (no flagship events nearby)

The release cadence is similar to past years, with a longer initial release cycle, including the end-of-year festivities and ~4-month ones. Please leave your feedback below or through a SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. DM by November 29.

Although the 6.8 dates aren’t final yet, they are close to final enough to let contributors know their availability around that time. If you want to participate in the WordPress 6.8 release, stay tuned for an upcoming post with the call for volunteers.

Props to @jeffpaul for reviewing the proposed dates and this post.

#planning

#6-8, #6-9, #7-0

Agenda, Dev Chat, Dec 4, 2024

The next WordPress Developers Chat will take place on Wednesday at 20:00 UTC in the core channel on Make WordPress Slack.

The live meeting will focus on the discussion for upcoming releases, and have an open floor section.

Additional items will be referred to in the various curated agenda sections below. If you have ticketticket Created for both bug reports and feature development on the bug tracker. requests for help, please continue to post details in the comments section at the end of this agenda.

Announcements

There are no major announcements from the past week.

Forthcoming releases

Next major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope.: 6.8

We are currently in the WordPress 6.8 release cycle. The call for volunteers for the 6.8 release squad is open until Dec 6. There is also a proposal open for the major releases for 2025.

Next maintenance release: 6.7.2

There is currently no release date planned for WordPress 6.7.2. Review the next minor release milestone.

Next GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ release: 19.8

The next Gutenberg release will be 19.8, scheduled for December 4. It will include the following issues.

Discussions

The discussion section of the agenda is to provide a place to discuss important topics affecting the upcoming release or larger initiatives that impact the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Team.

If you want to nominate a topic for discussion, please leave a comment on this agenda with a summary of the topic, any relevant links that will help people get context for the discussion, and what kind of feedback you are looking for from others participating in the discussion.

Editor Updates

You can keep up to date with the major Editor features that are currently in progress by viewing these Iteration issues.

Open floor

Any topic can be raised for discussion in the comments, as well as requests for assistance on tickets. Tickets in the milestone for the next major or maintenance release will be prioritized.

Please include details of tickets / PRs and the links in the comments, and if you intend to be available during the meeting for discussion or if you will be async.

Props to @joemcgill and @annezazu for contributing to this agenda.

#6-8, #agenda, #dev-chat

Internationalization improvements in 6.7

Various internationalization (i18n) improvements are in WordPress 6.7, and this developers note focuses on these.

Determining whether a translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. exists

Sometimes it can be useful to know whether a translation already exists for in memory without having to first load the translation for the given text domain. The new has_translation() function allows for exactly that.

See #52696 / [59029] for more details.

Sending emails in the adminadmin (and super admin)’s localeLocale A locale is a combination of language and regional dialect. Usually locales correspond to countries, as is the case with Portuguese (Portugal) and Portuguese (Brazil). Other examples of locales include Canadian English and U.S. English.

Back in version 4.7, WordPress added the ability for users to set their preferred locale. When sending emails to a user, they are always sent in that locale, and everyone else receives the email in the site’s locale.

Now, WordPress 6.7 is going a step further: every time an email is sent to the administrator email address (admin_email), WordPress checks if a user with the same email address exists. If so, the email is sent in that user’s locale.

See #61518 / [59128] for more details.

Warnings if translations are loaded too early

WordPress now warns developers if they are loading translations too early in a pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party or theme, before the current user is known. Existing functions like load_plugin_textdomain() and load_theme_textdomain() were updated to defer the actual loading to the existing just-in-time translation logic in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. This reduces the likelihood of triggering the warning, and even improves performance in some situations by avoiding loading translations if they are not needed on a given page.

Reminder: if your plugin or theme is hosted on WordPress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ and is still using load_*_textdomain(), you can remove this call. Since WordPress 4.6, plugins and themes no longer need load_plugin_textdomain() or load_theme_textdomain(). WordPress automatically loads the translations for you when needed. If you still support older WordPress versions or do not host your plugin/theme on WordPress.org, move the function call to a later hook such as init.

When attempting to load translations before after_setup_theme or init, WordPress tries to load the current user earlier than usual, without giving other plugins a chance to potentially hook into the process. It also prevents any plugins from filtering translation calls, e.g. for switching the locale or file location. Hence the addition of this warning to call out this unexpected behavior.

See #44937, [59127], and [59157] for more details.

Your plugin might be _doing_it_wrong() if you for example directly call get_plugin_data() (which attempts to load translations by default) or __() without waiting for the init hook. Here is a common example that was found in an actual plugin that was fixed:

/**
 * Plugin Name: Awesome Plugin
 */

function myplugin_get_version() {
	require_once ABSPATH . 'wp-admin/includes/plugin.php';
	// Prevent early translation call by setting $translate to false.
	$plugin_data = get_plugin_data( __FILE__, false, /* $translate */ false );
	return $plugin_data['Version'];
}

define( 'MYPLUGIN_VERSION', myplugin_get_version() );

If you do not explicitly set $translate set to false when calling get_plugin_data(), the function translates the plugin metadata by default. Since this plugin just needs the version number, there is no need for translating any of the other fields.

Another example:

/**
 * Plugin Name: Awesome Plugin
 */

class My_Awesome_Plugin {
	public $name;
	public function __construct() {
		// This triggers just-in-time translation loading
		$this->name = __( 'My Awesome Plugin', 'my-awesome-plugin' );

		// ... do something
	}
}

// This immediately instantiates the class, way before `init`.
$myplugin = new My_Awesome_Plugin();

Here, a class is immediately instantiated in the main plugin file, and code within the class constructor uses a translation function. This can be avoided by deferring the class instantiation until after init, or deferring the translation call until later when it is actually needed.

If your plugin is affected by this warning, you can use code like follows to find out the code path that triggers it:

add_action(
	'doing_it_wrong_run',
	static function ( $function_name ) {
		if ( '_load_textdomain_just_in_time' === $function_name ) {
			debug_print_backtrace();
		}
	}
);

Developer tools such as Query Monitor are also helpful in situations like this.


Props to @ocean90, @fabiankaegy for review.

#6-7, #dev-notes, #dev-notes-6-7, #i18n

What’s new in Gutenberg 19.7? (20 November)

“What’s new in GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/…” posts (labeled with the #gutenberg-new tag) are posted following every Gutenberg release on a biweekly basis, showcasing new features included in each release. As a reminder, here’s an overview of different ways to keep up with Gutenberg and the Editor.



Gutenberg 19.7 has been released and is available for download!

  1. Global Styles available on the main site editor sidebar
  2. Swifter hiding & showing the template
  3. Set image blocks as featured image
  4. Changelog
  5. First-time contributors
  6. Contributors

Global Styles available on the main site editor sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme.

The site editor sidebar is getting increasingly powerful, serving as the entry point to manage all-things your site. Up until this version, the styles panel offered limited style settings, focusing on style variations, color palettes, and typographies. Gutenberg 19.7 changes this by introducing a full-fledged Global Styles panel in its place, giving users site-wide granular control on styles at the top level.

Swifter hiding & showing the template

Switching between editing your site templates and content pages should be as smooth and seamless as possible; sometimes, you need to focus on the post content and hide the rest of the template. This was previously possible in the post settings, but now it is much easier thanks to the `Show template` toggle directly on the preview dropdown in the top toolbar.

Featured images offer a nice touch in external previews, making them more attractive to potential readers. However, it can be easy to forget to set one! To help set featured images more easily, image blocks now offer a dropdown action to directly set them as the featured image of the post or page containing the blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience..

Continue reading

#gutenberg, #gutenberg-new

Introducing Twenty Twenty-Five

The WordPress 6.7 release will feature a new default theme: Twenty Twenty-Five.

Four public domain film photographs: one showing a historical building, the other a close up of flowers, the other shows birds and the other an African woman. Below it is written Twenty Twenty-Five.

Concept

While ideating Twenty Twenty-Five, one recurring idea was that simple things should be intuitive while complex things should be possible. This concept of simplicity and complexity leads to a reliable foundation for extending a default WordPress experience to make it yours.

Twenty Twenty-Five embodies ultimate flexibility and adaptability, showcasing the many ways WordPress enables people to tell their stories with many patterns and styles to choose from. The glimpses of natural beauty and ancestry woven into the theme evoke ideas of impermanence, the passage of time, and continuous evolution.

The demo content imagery, all from the Public Domain, carries a poetic, universal, and ubiquitous tone that complements the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. concept. There was an opportunity to visually lean into a positive tone to bring softness, lightness, and inspiration through its aesthetic.

A collage kind of composition showing many of the photographs used in the 2025 default theme.

Patterns

Structurally, Twenty Twenty-Five offers a robust set of patterns, promoting interoperability and enabling users to compose intentional pages quickly. A broad range of patterns was designed for categories such as services, about, landing pages, products, calls to actions, events, and others.

A broad range of patterns designed for the 2025 theme in categories like services, about, landing pages, products, calls to actions, events, etc.

Styles

Given the theme’s global use, high-quality and comprehensive fonts that support multiple languages have been considered from the first conceptual steps of the design. Furthermore, we’re refining a set of diverse color palettes to be bundled within the theme as style variations.

Eight different color palettes that were designed for the 2025 default theme.
Eight different typography pairings that were designed for the 2025 default theme.
Showing nine examples applied to different templates of style variations designed for the 2025 theme.

Templates

Twenty Twenty-Five also features a versatile set of blogblog (versus network, site) templates: text-centric blogs with sidebars, photo blogs that highlight featured images, and more complex blogs with diverse content. Twenty Twenty-Five will be fully compatible with the Site Editor and will use many of the new design tools like the Grid blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. and Pattern/Section Styles.

Personal Blog (Default)

In keeping with the idea of simplicity, the personal blog tendency is to lean on a default template that just works, whether you want to write a post with a title and featured imageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts. or not, and showing all the post’s content out-of-the-box, instead of just excerpts.

Two mockups: the one on the left shows blog posts with an image, a post title and the full content of the post and the one on the right shows a single post.

Photo Blog (Alternative)

The alternative “photo blog” templates tailored primarily for photography or portfolios lean on an image-heavy approach, with interesting layouts that can be used for a variety of purposes.

Two mockups: the one on the left shows just the featured image of blog posts and the one on the right shows a single post with a full width image.

Complex Blog (Alternative)

Lastly, the set of complex blog alternative templates would be more suitable for websites with greater complexity in content. Some of these templates, with more variety in type scales and more opinionated designs can also appeal to different audiences.

Two mockups: the one on the left shows a 3 column grid with blog posts containing featured images and post titles followed by a 2 column grid, and the one on the right shows a single post with a big left-aligned title, post meta and a wide image, followed by post content with a sidebar on the right.

Development

As part of the 6.7 release, Carolina Nymark (@poena) and Juanfra Aldasoro (@juanfra) are leading development while Beatriz Fialho (@beafialho) is leading design. If you’re interested in contributing, make sure you’re following this blog; we look forward to your involvement and support throughout the process. 

The Figma file is the design source of truth. Comments in the main file are open, and anyone should feel free to duplicate the Figma to their drafts and remix. Both of these actions are free, whereas every edit access is paid and therefore reserved.

Theme development will happen on the Twenty Twenty-Five GitHub repository. You can contribute by submitting and reviewing pull requests or opening new issues and, as usual, once the theme is stable, it will be merged into Core and the GitHubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ repository will be archived.

Starting on Wednesday August 21st at 3:00 PM UTC , there will be weekly Slack meetings in #core-themes to coordinate development of the theme. Agenda notes will be posted before meetings and summaries posted after the meeting.

Learn more

For information about previous default themes, read the following posts:

Here are a few resources if you’re interested in learning more about Block Themes and the Site Editor:

+make.wordpress.org/themes/

Props @richtabor, @karmatosed, @priethor, @poena, @cbringmann and @joen for helping co-create this post and to @luminuu for proofreading it.

#6-7, #bundled-theme, #twenty-twenty-five

New Plugin Template Registration API in WordPress 6.7

Since the introduction of blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. themes, theme authors have been able to create custom block templates. However, this possibility was limited to themes, leaving plugins without a straightforward way to register their own templates. To achieve similar functionality, plugins had to resort to complex methods, including hooking into multiple PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher filters, manually creating WP_Block_Template objects, and replicating internal WordPress logic.

WordPress 6.7 introduces a new APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. that will significantly simplify the process for plugins to register their own block templates. To enable this, two new functions have been introduced: register_block_template() for registering a block template and unregister_block_template() for unregistering it.

register_block_template( string $template_name, $args = array() ) accepts two parameters, that define how the template is registered:

  • $template_name: The name of the template in the form of plugin_uri//template_name (note that this requires a double //).
  • $args: An array of arguments for defining the template:
    • title: An internationalized title for the template.
    • description: An internationalized description of the template.
    • content: The default content (block markup) for the template when rendered in the editor or on the front end.
    • post_types: An array of post type slugs to make available to users as per-post custom templates.

For example, a pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party can register a template with the following snippet:


register_block_template( 'devblog-plugin-templates//my-template', [
	'title'   	=> __( 'Example', 'devblog-plugin-templates' ),
	'description' => __( 'An example block template from a plugin.', 'devblog-plugin-templates' ),
	'content' 	=> '
    	<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->
    	<!-- wp:group {"tagName":"main"} -->
    	<main class="wp-block-group">
        	<!-- wp:group {"layout":{"type":"constrained"}} -->
        	<div class="wp-block-group">
            	<!-- wp:paragraph -->
            	<p>This is a plugin-registered template.</p>
            	<!-- /wp:paragraph -->
        	</div>
        	<!-- /wp:group -->
    	</main>
    	<!-- /wp:group -->
    	<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->'
] );

Once registered, the template will appear alongside all other templates in the Site Editor:

And, if needed, could later unregister it with:

unregister_block_template( 'devblog-plugin-templates//my-template' )

Plugins can also override templates from the WordPress template hierarchy, such as the archive page of a custom post typeCustom Post Type WordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept. or a specific author page.

Theme templates take priority over plugin-registered templates, allowing themes to override specific plugin templates just as they can with WordPress templates.

Currently, this API is limited to block templates and does not allow the registration of block template parts.

You can read more about this new feature in the following links:

Props to @aljullu for writing this dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase.. And thanks to @fabiankaegy for reviewing

#6-7, #dev-notes, #dev-notes-6-7