The WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. development team builds WordPress! Follow this site for general updates, status reports, and the occasional code debate. There’s lots of ways to contribute:
Found a bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority.?Create a ticket in the bug tracker.
Following sessions are dedicated to move things forward and be ready in time according to 6.4 Release Schedule.
Everyone is welcome to join not only to triagetriageThe act of evaluating and sorting bug reports, in order to decide priority, severity, and other factors. tickets but also to look for tickets you can contribute by creating patches, making code review and testing. Keep in mind that all features and enhancements should be in the TrunktrunkA 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. before BetaBetaA 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 and most bugs and all strings need to be there before RC1. If you are working on a patchpatchA special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing., plan your contribution to have enough time for other contributors to make suggestions, review and test.
Monday September 25, 2023 at 19:00 UTC for a last scrub before BetaBetaA 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
Monday October 16, 2023 at 17:00 UTC for a last scrub before RCrelease candidateOne 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). 1
Release Candidaterelease candidateOne 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). Bug Scrubs (if needed)
Focus: issues reported from the previous RC.
TBD
Check this schedule often, as it will change to reflect the latest information.
Regular component scrubs and triage sessions
For your reference, here are some of the recurring sessions:
Have a regular component scrub or triage session? PingPingThe act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.”@audrasjb, @oglekler or @marybaum on SlackSlackSlack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. to have it added to this page.
You can start your own triage sessions
Decide what you want to work on
6.4 triage session are our priority and moving forward tickets which already are scheduled for the release is most needed task. If you want to lead some of them, they can be added on this schedule.
But if you are interested in particular component or user focus, for example to take care about RTL-tickets, this will be most welcome too.
Especially interested can be the session to scrub old tickets. We are continuously closing new tickets with the same topic in favor of existing ones and because these tickets are looking complicated just because they’re age not, so many contributors are eager to work on them, but there are actual treasures hidden among very difficult or tricky topics.
Ping@oglekler or @marybaum on Slack with the day and time you’re considering as well as the report or tickets you want to scrub.
Use this list to focus on highest priority tickets first.
Use this list to focus on tickets that haven’t received love in a while.
Report 6 provides a list of open 6.4 tickets ordered by workflow.
Need a refresher on bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. scrubs? Checkout Leading Bug Scrubs in the coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. handbook.
“What’s new in GutenbergGutenbergThe 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 Site Editor project (formerly called Full Site Editing).
The latest release includes several new enhancements, loads of bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. fixes, and continued work on Phase 3 features.
After a successful implementation of renaming Group blocks in Gutenberg 16.7 and feedback that the feature should be opened up, version 16.9 lets you rename nearly every block. A bonus for this feature is that theme authors can use this to label blocks in their theme templates and patterns.
There are a few blocks that cannot be renamed:
core/block
core/template-part
core/pattern
core/navigation
Duplicate and rename patterns and more
Pattern management is getting a lot of nice feature additions. For individual patterns, you can now rename or duplicate them:
Gutenberg 16.9 also introduces two new media categories: Audio and Video. This should help better organize patterns by media type.
Other Notable Highlights
The Dimensions design tool control’s layout is much improved (55060).
The Template Part blockBlockBlock 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. now falls back to the current theme is there is no theme attribute provided (55217).
A ton of CSSCSSCascading Style Sheets. Level 4 viewport-relative units are now supported for more flexible control over various sizing options (54415).
getEntityRecords() calls now return pagination totals in the returned data (55164).
Enable Block Renaming support for (almost) all blocks. (54426)
Enhancements
Command APIAPIAn 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.
Add block-specific commands as contextual suggestions [#53539]. (53974)
Add type="button" to vanilla <button> elements. (55125)
ConfirmDialog: Ts unit testunit testCode written to test a small piece of code or functionality within a larger application. Everything from themes to WordPress core have a series of unit tests. Also see regression. storybook. (54954)
GradientPicker: Remove padding and disable overflow of color picker popovers. (55265)
Migrate Composite component from reakit to ariakit. (54225)
Editor: Use hooksHooksIn WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. instead of HoCs in PostExcerpt. (55189)
Design Tools
Allow using CSS level 4 viewport-relative units. (54415)
Migrating AddCustomTemplateModalContent to use updated Composite implementation. (55256)
Private APIs
Update consent string for using private APIs. (55182)
New APIs
CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. Data: Retrieve the pagination totals in the getEntityRecords calls. (55164)
Bug Fixes
Block Library
PHPPHPThe web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher notice when an image with lightbox is deleted. (55370)
Cover Block: Check for previously uploaded media before setting the dimRatio. (55422)
Cover: Fix media type check in the onSelectMedia hook. (55168)
Fix Block Rename UIUIUser interface perf regressionregressionA software bug that breaks or degrades something that previously worked. Regressions are often treated as critical bugs or blockers. Recent regressions may be given higher priorities. A "3.6 regression" would be a bug in 3.6 that worked as intended in 3.5.. (55250)
Fix PHP notice when an image with lightbox is deleted in the behaviors file. (55385)
Fix: Wrong condition on cover block dimRatioToClass. (55356)
Image: Fix Lightbox display bug in Classic Themes. (54837)
Latest Posts: Add screen reader title text to Read more links and use alternative to excerpt_morefilterFilterFilters 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.. (55029)
Latest Posts: Sync updates from Core (6.4). (55181)
List View: Change the aria-description attribute to aria-describedby. (55264)
Query LoopLoopThe Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region. (55309)
Site Editor
Alternative: Fix template part area listing when a template has no edits. (55115)
Do not display ‘trashed’ navigation menus in SidebarSidebarA 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.. (55072)
IframeiframeiFrame is an acronym for an inline frame. An iFrame is used inside a webpage to load another HTML document and render it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser. / block drag chip: Fix positioning when dragging over an iframe. (55150)
ProgressBar: Use text color to ensure enough contrast against background. (55285)
Make date headerHeaderThe header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. translatable. (55445)
Patterns
Add categoryCategoryThe 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging. selector to pattern creation modal. (55024)
HTMLHTMLHyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. API
Fix: Directive processor failing on updated HTML API. (55404)
Widgets Editor
Only suppress adminadmin(and super admin) notices when JavaScriptJavaScriptJavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. is enabled. (55403)
Add selector as id to layout style overrides. (55291)
History
Try: Only render LastRevision component if pluginPluginA 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 is active. (55253)
Block Directory
Fix filtering for downloadable blocks in inserter. (55243)
Global Styles
Use all the settings origins for a block that consumes paths with merge. (55219)
Post Editor
Fix wrong notification message shown when an entity is moved to trashTrashTrash in WordPress is like the Recycle Bin on your PC or Trash in your Macintosh computer. Users with the proper permission level (administrators and editors) have the ability to delete a post, page, and/or comments. When you delete the item, it is moved to the trash folder where it will remain for 30 days.. (55155)
Typography
Font Library: Show error if fetching collection fails. (54919)
Colors
I18ni18nInternationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill. Make No color selected translatable text. (54814)
Rich Text
Paste: Only link selection if URLURLA specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org protocol is http(s). (53000)
Patterns
Remove the version enforcement for npm in engines field. (55245)
Code Quality
Fix: Use y-webrtc room name terminology instead of docName. (55260)
AccessibilityAccessibilityAccessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility)
Global Styles
Fix flickering when focusing on global style variations. (55267)
Interactivity API
Fix Image block lightbox missing alt attribute and improve accessibility. (55010)
Components
Modal: Fix closing when contained iframe is focused. (51602)
Block Library
Cover: Add aria-label to fixed and repeated image backgrounds. (50990)
Add featured imageFeatured imageA 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. field to the page list. (55246)
Adds a control to the views actions to switch layouts. (55311)
Add author and status filter to the page list. (55270)
Documentation
Add “Get started with create-block” doc to the Getting Started section. (55373)
Add a “Get started with wp-scripts” doc to the Getting Started section. (55372)
Add backgroundImage to the theme jsonJSONJSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. documentation for appearanceTools. (55376)
Add initial documentation for the DataViews component. (55435)
Augment Block.Edit filter documentation with performance guidance. (55252)
Correct the documented type for the $w parameter of block_core_navigation_add_directives_to_submenu(). (53585)
Document kind, name, plural for entity configuration. (55158)
Document updating the consent string to unlock private APIs. (55235)
Explain how to translate Gutenberg in standalone apps using the editor packages. (55080)
Fix callouts in end-to-end test documentation. (55300)
Fix code formatting due to bug in the “Get started with wp-env” doc. (55458)
Fix the position of the callout in the “Get started with wp-scripts” doc. (55457)
Font Library: Change all references to 6.4.0 by 6.5.0 core version. (55320)
Initial documentation of entity configuration. (55103)
PHP lib docs: Update to include information about prefixes in block PHP code. (55402)
Platform docs: Add a page to explain how to render HTML from a list of blocks. (55140)
Remove @return void from PHP function docs. (55237)
Further items will continue to be added as they come up in coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. and release leads channels on SlackSlackSlack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/..
WordPress 6.4 Release Candidate 2 is available – please help test and make the release the best it can be. All details are on the post. Thanks to everyone who contributed towards this..
Highlighted posts
Due to time constraints during a release and to prioritize 6.4 items, some of the highlighted posts may not be raised during the live Dev Chat meeting.
You can also find all Developer Notes relating to 6.4 using this tag
If you think a ticketticketCreated for both bug reports and feature development on the bug tracker. needs a dev notedev noteEach 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 it has not been highlighted previously, send a message to Nalini on Slack for those working on the docs release or add it to the Documentation Tracker for 6.4
Project Board for Editor Tasks for WordPress 6.4 on GitHubGitHubGitHub 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/
GutenbergGutenbergThe 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/
Tickets or Components help requests
Please add any items for this part of the agenda to the comments – tickets for 6.4 will be prioritized. If you can not attend dev chat live, don’t worry, include a note and the facilitator can highlight a ticket if needed.
Open floor
If you have any additional items to add to the agenda, please respond in the comments below to help the facilitator highlight them during the meeting.
No agenda was posted prior to this meeting. The full chat log is available beginning here on Slack.
Announcements
We will shift the time of this meeting starting next week, October 31 at 16:00 UTC, to account for seasonal time changes starting next week in Europe.
Today is WordPress RCrelease candidateOne 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). 2. Everything in the performance focus for this release has been resolved. Thanks to everyone who contributed to the 67 resolved performance focus tickets in this release 🎉
The fortnightly bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. scrub is scheduled for tomorrow at 15:00 UTC in #core-performance in SlackSlackSlack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/..
We plan to review 6.5 tickets. If anyone has things they plan to work on during this release, please make sure they are added to the milestone in advance of that meeting.
@swissspidy is drafting a blogblog(versus network, site) post covering next steps for merging the Performant Translations pluginPluginA 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 (#59656)
Would like feedback from other experienced developers.
@flixos90 plans to look into what to prioritize for 6.5 related to improving autoloaded options. He thinks some of the focus may actually go into the Site Health audit part of Performance Lab (related tracking issue)
JavaScriptJavaScriptJavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. & CSSCSSCascading Style Sheets.
@westonruter No updates for script loading strategies, except that WP 6.4 will implement them on the frontend.
@pereirinha I’ve been doing research on #59595. Was supposed to do an update last week, but I didn’t like the results. Today, he returned to it and is much happier with the direction. He plans to update the ticketticketCreated for both bug reports and feature development on the bug tracker. before EOD. There will be findings and potential solution.
@joemcgill We had a lively discussion last week during the hallway hangout about this topic.
@flixos90 “Hard to summarize, but TLDR I think we are still trying to figure out ways to get more consistent (as in “less variance”) benchmarks within a single environment. While we apparently saw some more consistent metrics in the compare-wp-performance workflow that @swissspidy implemented, there is still high variance, and even the same WordPress versions may produce vastly different numbers. There’s a good chance that this is simply because GH Actions workers aren’t suitable for this kind of testing as they vary in their environment”
After the meeting, @flixos90 noticed that we already have a GH issue that we can use to pick up this conversation, async.
@flixos90 – I’ve been working on a simple PR to support detecting the kind of content for a WordPress URLURLA specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org in HTTPHTTPHTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. Archive: https://github.com/HTTPArchive/custom-metrics/pull/96
Last week we had security and maintenance releases for both WordPress and the GutenbergGutenbergThe 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/pluginPluginA 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: https://wordpress.org/news/2023/10/wordpress-6-3-2-maintenance-and-security-release/ and https://github.com/WordPress/gutenberg/releases/tag/v16.8.1. Please make sure they are both updated. WordPress 6.4 RC1 was released on October 17 https://wordpress.org/news/2023/10/wordpress-6-4-release-candidate-1/.
Open floor
There were two questions raised by Andrei Glingeanu.
Question 1:
Is the possibility of adding custom tabs here prohibited intentionally?
Print screen of the blockBlockBlock 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. inspector sidebarSidebarA 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. with a custom item added at the side of the page and block.
We never added extensibility api’s to create new tabs there. There was not an intentional decision to never do it, but there was also never a decision to do it. I guess the best bet for now is to create a custom sidebar.
Question 2:
Is there a standard way of outputting dynamic css for a custom block besides putting it inline in style="" attributes and without outputting <style> tags in the edit function of the block?
If the dynamic CSSCSSCascading Style Sheets. styles you want to add should affect just a single instance of the block I think using the style attribute may be the way to go.
If the dynamic CSS styles you want to add should affect all the instances of your custom block, I guess a good option is to use the global styles filters and filterFilterFilters 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. theme.jsonJSONJSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. to add the styles you want for the block dynamically.
If it is dynamic but there is a limited set of different possible styles e.g.: dynamic but there are like 5 different style configurations. Probably creating classes as part of the block styles CSS and then dynamically deciding which class to add to the block seems to be the way to go.
RevisionsRevisionsThe WordPress revisions system stores a record of each saved draft or published update. The revision system allows you to see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what has changed in each revision. are now supported for post metaMetaMeta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. on an opt-in basis. This feature is currently used by coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. for footnotes – enabling footnotes to be correctly previewed, stored in autosaved and stored and retrieved from revisions. In the future, this may be expanded to the featured imageFeatured imageA 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. which is also stored in meta.
When registering a new meta field with register_meta or register_post_meta, the $args parameter accepts a new revisions_enabled argument. This defaults to false—set to true to opt in to revisions for this meta field. Note that the object type the meta is being created for must have revision support in order for the meta field to have revisions enabled. Attempting to enable meta revisions for a post type that doesn’t support revisions will result in a doing_it_wrong warning.
This feature is designed to lay the groundwork for future improvements to GutenbergGutenbergThe 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/ as part of Phase 3: Collaboration. Care has been made to do this in a backwards compatible manner, but if you are unhooking anything in the post save/update process, please read this entire note and test your code before WordPress 6.4 is released.
A new wp_post_revision_meta_keysfilterFilterFilters 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. is introduced, which can be used to filter the list of meta fields to be revisioned. The post type is also passed to the filter, which can be used to adjust revisioning of meta fields.
// Example to add a `my_product_price` meta field to revisions.
function enable_revisions_for_product_price_field( $revisioned_keys ) {
if ( ! in_array( 'my_product_price', $revisioned_keys, true ) ) {
$revisioned_keys[] = 'product_price';
}
return $revisioned_keys;
}
add_filter( 'wp_post_revision_meta_keys', 'enable_revisions_for_product_price_field' );
The _wp_put_post_revision action, which fires once a revision is saved, includes a new parameter—the post ID associated with the revision. This is used by core to copy the meta data from the main post to the revision.
The wp_creating_autosave action, which fires before an autosave is stored, includes a new parameter `$is_update`, added to indicate if the autosave is being updated or was newly created.
Meta revisions are also stored for autosaves and when previewing posts, fixing a long standing bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. (#20299) that caused live post meta to be overwritten when post meta was previewed. This is because using update_post_meta to save meta to a revision actually resulted in it being saved to the parent post. With this change, developers can now opt in to meta revisions and core will correctly attach the meta data to the revision. Meta that has revisions is also restored when restoring an autosave or revision.
The REST APIREST APIThe REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”) https://developer.wordpress.org/rest-api/. revisions endpoint now returns meta when stored as part of a revision and the autosaves endpoint now handles storing of meta.
The new meta revision features are enabled in core via hooksHooksIn WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same.; removing the hooks will disable the features:
Important note: as part of this change, the timing for the storing of post revisions has been changed. Previously, revisions were created before post meta had been saved by the REST API on the post_updated hook. Revisions are now hooked on the wp_after_insert_post action, fired after post meta has been saved.
Special backwards compatibility consideration has been given to plugins that may be unhooking post_updated from wp_save_post_revision to disable revisions—in that case, core ensures revisions are still not created.
This guide shares more in-depth changes that you will find in 6.4 and is published in the Release Candidaterelease candidateOne 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). cycle to help inform WordPress developers, extenders, and others. The release squad and many contributors across the global project have worked to bring these changes, and you can follow this work and add to the contribution using the ticketticketCreated for both bug reports and feature development on the bug tracker. systems in Trac and GitHubGitHubGitHub 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/.
Some fascinating stats! TracTracAn open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. has about 268 tickets, 113 of which are enhancements and feature requests, 134 bug fixes, and 21 other tasks. This time, there are more than 64 tickets with a focus on performance, 17 for accessibility, and 16 for modernizing code and applying coding standards. GutenbergGutenbergThe 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/’s GitHub repo brings more than 1,400 updates/changes, providing to coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. more than 420 enhancements, 445 bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. fixes, and 42 accessibility improvements.
Changes in 6.4 are spread across about 45 core components. Below is the breakdown of the most important ones.
You can also find all Developer Notes relating to 6.4 as they continue to be published until the release goes live. You can follow them using this tag.
BlockBlockBlock 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. Editor
WordPress 6.4 is bringing six Gutenberg releases into the core – 16.2, 16.3, 16.4, 16.5, 16.6, 16.7. You will find Block HooksHooksIn WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same., the ability to register their own media categories, changes to the @wordpress/components package, updates for the user interface components, and many other changes.
WordPress 6.4 introduces Block Hooks (#53987), a feature that provides an extensibility mechanism for Block Themes. This is the first step in emulating WordPress’ Hooks concept that allows developers to extend Classic Themes using filters and actions.
There are a number of other changes, including a new background image block support, fluid typography, disabled layout controls globally or on a block basis by theme.json, Stabilized APIs for InnerBlocks, and much more.
Two new functions abstract the HTMLHTMLHyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. markup generation to reduce the maintenance burden, encourage consistency, and enable argument and message filtering for all admin notices used widely in WordPress Core and the extender community.
A developer note will be added later on the following change:
Introduce wp_trigger_error() to complement _doing_it_wrong()#57686
HTML APIAPIAn 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.
WordPress 6.4 includes continued development of the HTML API, including the introduction of a minimal HTML Processor with the concept of breadcrumbs, and makes it possible to, for example, search for images that are direct children of a DIV.
Also included in 6.4, is the addition of a couple of CSSCSSCascading Style Sheets./class helpers in the Tag Processor, which will make it possible to search for a tagtagA 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.) containing more than one class name, or to search for a tag not containing a given class name.
New WordPress installations will now have attachment pages fully disabled for new sites. This will benefit SEO by avoiding attachment pages created by default, which were indexed by search engines and could have led to bad results for users and site owners. The change introduces a wp_attachment_pages_enabled database option to control the attachment pages’ behavior. In the dev notedev noteEach 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., there is information on how to update existing sites.
New functions wp_load_options(), get_options(), and wp_set_option_autoload_values() allow an enhanced performance of retrieving options from the database.
Performance gains have been achieved by introducing caching using an object cache in a new method called WP_Theme::get_block_patterns().
Unnecessary checks were removed if a theme file existed in the theme functions that enhanced efficiency and performance. These improvements in the Themes API mean the current theme’s stylesheet directory is checked to ensure it matches the template directory, before further file existence checks are done. Improvements are also in the performance of get_block_theme_folders(). This is through a new method, WP_Theme::get_block_template_folders(), and improved error handling. The result is a quicker and more efficient lookup of block template folders within themes. WordPress developers and users can anticipate improved performance, reduced I/O overhead, and a smoother experience when working with block themes.
Improved image loading
Several enhancements to the wp_get_loading_optimization_attributes() function, which provides a central place to manage loading optimization attributes, specifically for images and iframes.
In WordPress 6.4, script loading strategies are now employed for frontend scripts in core and bundled themes. For the most part, the defer loading strategy is used since it is more consistent in its loading behavior, in that a defer script always executes once the DOM has loaded; a script with async may actually block rendering if it is already cached. Additionally, loading with defer has been moved from the footer to the head so that they are discovered earlier while the document is loading and can execute sooner once the document is loaded.
This dev note highlights the changes made in WordPress 6.4 to style loading. The main focus of the changes was to replace manually created style tags printed at the wp_head action with calls to wp_add_inline_style().
TaxonomyTaxonomyA taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies.: The double sanitization in the get_term function has been stopped. This will prevent the unnecessary calls to sanitize_term, which was detrimental to performance. Trac ticket #58329.
Themes: The TEMPLATEPATH and STYLESHEETPATH constants have been deprecated. get_template_directory() and get_stylesheet_directory() should be used instead. Trac ticket #18298
And there’s more!
Some of the additional changes in 6.4 to highlight.
Users
WordPress 6.4 brings a number of key improvements to the HTML markup of the wp-login.php page to make its structure more optimal and allow developers to have more customized individual styling flexibility. #30685
Clarify the “Add New” links in the Admin for better accessibilityAccessibilityAccessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility)
In WordPress 6.4, the default values for the add_new label changed to include the type of content. This matches add_new_item and provides more context for better accessibility. The default value is ‘Add New Type’ for both hierarchical and non-hierarchical types. If you’ve previously used a label such as:
Props to @jrf for the information for this dev note.
HTTPHTTPHTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. API
HTTP API: WP_Http_Curl and WP_Http_Streams classes and filters have been deprecated as these classes have not been used in WordPress Core since the introduction of the Requests library. Trac ticket #58705
RevisionsRevisionsThe WordPress revisions system stores a record of each saved draft or published update. The revision system allows you to see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what has changed in each revision.
Revisions are now supported for post metaMetaMeta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. on an opt-in basis. Trac ticket #20564
Props to @costdev, @bph, @nalininonstopnewsuk, @codente, @spacedmonkey, @desrosj, @flixos90 for input on this Field GuideField guideThe field guide is a type of blogpost published on Make/Core during the release candidate phase of the WordPress release cycle. The field guide generally lists all the dev notes published during the beta cycle. This guide is linked in the about page of the corresponding version of WordPress, in the release post and in the HelpHub version page., and @joemcgill, @clarkeemily, @cbringmann, @akshaya, @611shabnam, and @priethor for peer review. Thank you to all those involved in collating, writing, and editing developer notes relating to 6.4.
Over the last few months, I’ve had 20+ conversations with various folks across the WordPress ecosystem, from developers implementing WordPress at scale to folks working in large newsrooms to one-person operations. After leaving comments on the various Phase 3 posts, it felt advantageous to write a quick summary of the feedback to help inform our future work, akin to the efforts of the FSE Outreach program, and encourage others who might be having similar conversations to continue to share for the entire project to benefit from.
Overview
Most conversations lasted about 45-60 minutes, with very few running into the two-hour range. The conversations were open ended with folks broadly sharing their content process from ideation to completion and ended talking about the various phase 3 related posts with encouragement to engage. Of the 24 conversations, I have roughly grouped them across the following categories:
3 individual developers with either experience implementing WordPress at scale or building collaborative tooling.
1 person representing higher education.
2 people running their own individual projects/sites.
10 larger newsrooms or organizations.
8 smaller newsrooms or organizations.
These were sourced from a variety of connections including: GitHubGitHubGitHub 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/ issue creators, WordPress VIP intros, Newspack clients, “cold emailing”, folks from the FSE Outreach Program, and more. In full disclosure, I am sponsored by Automattic to do this work and leveraged these connections to reach out to a broader range of folks. For many, they are using a suite of tools to get the job done, often without deep integration, and usually landing in WordPress when the copy is nearly complete. Phase 3 would/could shift that experience, allowing folks to land and work within WordPress sooner and with that comes a list of features and requirements. Read on!
At a high level, I repeatedly heard from folks in larger organizations more of an interest in collaboration in the form of the ability for multiple people to be in different parts of an article over true collaborative editing. Especially for larger to medium-sized publishers, there’s less of a need for real-time collaboration and more of a need for different sets of folks in an article simultaneously with blocks locked individually. The same applies to the experience of editing the details of a post, like a categoryCategoryThe 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging. or featured imageFeatured imageA 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. while not having access to edit the entire post itself. For example, someone from the photo team can place images without having the ability to edit the content blocks, or a handful of folks being able to edit tags directly without getting in the way of the writers.
Multiple people editing a doc at once.
Role-specific permissions allowing some folks to accept/deny various edits.
More granular ability to edit specific parts of a post/page at once without having full access to everything, including blockBlockBlock 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. leveling locking.
Commenting functionality, including the ability to @ folks.
Public preview link for folks, regardless of whether they have access to the site.
Workflows
No one I spoke with manages everything in WordPress with a wide range of additional tools and workflows in use from extraordinarily complex and manual to some setups with deeper automatic integration (status changes in X which automatically updates Y at the next step) to more manual organizing before adding anything into WordPress (adding images to a folder on a desktop before uploading). A need for a dashboard/task manager is clear as well as a need for integration with other tooling.
Support for tasks that can be customized depending on the post type and have a built-in “severityseverityThe seriousness of the ticket in the eyes of the reporter. Generally, severity is a judgment of how bad a bug is, while priority is its relationship to other bugs.” type (required vs nice to have). For example, a task might be more of a nice to have than a necessity, but both are worth calling out for the person to act on.
Tie notifications into different tasks and the status of articles to reduce the need to pingPingThe act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” someone in a separate system. For example, perhaps legal needs to be emailed about an article, or the media team needs to be notified that a post is ready for images.
Ability to see open tasks/open notifications with ease (task manager), along with an at-a-glance view of where something might stand (editorial calendar).
Section level locking for different parts of a post, like the post content vs. post title vs. featured image, tied into task management with perhaps reviews needed for each before publishing.
Solid integration options with other tools, like SlackSlackSlack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/./TrelloTrelloProject management system using the concepts of boards and cards to organize tasks in a sane way. This is what the make.wordpress.com/marketing team uses for example: https://trello.com/b/8UGHVBu8/wp-marketing./Asana, for notifications and state changes (draft to pending review, reminding folks about assignments, etc).
Easy draft sharing for varying permission levels including stakeholders without access to the site itself.
Ability to publish with multiple authors.
RevisionsRevisionsThe WordPress revisions system stores a record of each saved draft or published update. The revision system allows you to see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what has changed in each revision.
The most commonly requested items proved to be more visual revisions and the ability to track more than just post content changing. These stood out amongst the rest as the most broadly useful items.
More visual revision history, perhaps with the option to toggle between code views.
Ability to track more than just post content, including changes to tags, a featured image, SEO, and other custom fields (like managing multiple headlines).
Ability to split out a revision to develop it separately from the main draft and keep track of how the current version continues with some form of track changes (this is likely more in an async workflow, but it relates).
Ability to see a notice of an audit trail when coming into a post after a few revisions, including who made which changes. For example, if an editor went through and made a number of changes to a post so the writer can see the difference.
A way to focus on a particular part of an article to see how it might have changed, rather than the entire piece.
Improved management of posts with numerous revision history events (think 50+). It’s currently pretty painful to try to go through revisions at scale.
Tied to this, I’ll note from the FSE Outreach Program that feedback has come in very positively around the Style Revision experience both in terms of the visual nature and easy to understand timeline with a request to have that in place for templates and template parts.
Block library
The ability to configure more granular control over blocks continues to come up as a pain point, especially as more support is added by default in different ways that cause folks to feel a level of uncertainty and scrambling to keep up. Anything we can do to consolidate the methods for controlling block access and support would go a long way. For example, even if you use theme.jsonJSONJSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. to lock down all support and settings for coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress./media-text, block settings still appear in the block sidebarSidebarA 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. due to that being defined in core/media-text’s component code and inserted in a custom panel.
Tied to this, folks want the ability to see where patterns are used across a site (“this pattern is used on x number of posts”) as a better way to gauge the impact of changes, particularly for synced patterns.
Media management, from the ability to add folders to controlling copyright information, are big concerns for folks, especially in larger organizations where many images are uploaded per day.
Way to manage and view image attribution and copyright information. This was repeated often as a high priority item and major pain currently.
Improved alternative text management.
Ability to add folders.
Improved searchability.
Ability to upload photos designed for a specific post and having those photos surfaced when working on a post.
Adminadmin(and super admin) redesign
There was a lack of overall feedback here as folks mainly focused on wanting the experience to be “more modern” without a lot of specific feature requests.
The ability to reorder, hide, and favorite menu items for greater customization.
Desire for a redesign to modernize the experience. This was nonspecific but repeated feedback that ties into Data Views work.
Going forward
As more conversations occur and work progresses, I’ll continue to bring feedback into appropriate GitHub issues and/or create new ones. For more open ended feedback, like the above, I’ll do recap posts as appropriate. If you’re chatting with folks about Phase 3 efforts, please do the same! Similar to Phase 2, we’ll need folks across the WordPress community to have conversations, educate, and bring others along.
Want to chat about phase 3 in the future? Comment below.
If you’re interested in joining future hallway hangouts on the topic, please leave a comment below and I’ll @ your username for any future hallway hangouts I run going forward.
WordPress 6.4 includes continued development of the HTMLHTMLHyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers.APIAPIAn 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., including the introduction of a minimal HTML Processor in #58517 and the addition of a couple of CSSCSSCascading Style Sheets./class helpers in the Tag Processor in #59209.
A minimal HTML Processor and its breadcrumbs.
When the HTML Processor was introduced in WordPress 6.2, it carried the stipulation that it did not understand HTML structure. While this is an intentional limitation so that the Tag Processor can maintain predictable performance and simplicity, it leaves certain conditions awkward and bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. prone. Consider, for example, the goal of finding an IMG element inside a surrounding DIV.
$processor = new WP_HTML_Tag_Processor( $html );
// Find the wrapping DIV element.
if ( ! $processor->next_tag( 'DIV' ) {
return $html;
}
// Find the inner IMG element.
while ( $processor->next_tag( array( 'tag_closers' => 'visit' ) ) ) {
// Abort if leaving the DIV wrapper before finding the image.
if ( 'DIV' === $processor->get_tag() && $processor->is_tag_closer() ) {
return $html;
}
if ( 'IMG' === $processor->get_tag() ) {
do_something_to_img();
return $processor->get_updated_html();
}
}
This code maintains the safety against unexpected HTML inputs in the way that a regex-based approach would not, but it’s already a bit cumbersome, and could be mistaken by an unexpected HTML layout. For example, it assumes that a closing DIV tagtagA 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.) will appear and that it will only appear after the IMG. It will fail to recognize the nested IMG in the following HTML because of the nested DIV before it.
The new WP_HTML_Processor() class is being built in order to not only understand HTML syntax, but also its semantics – it understands HTML structure and all the quirks involved when discussing “malformed HTML.” In WordPress 6.4 the HTML Processor is available, and it adds a new concept of “breadcrumbs” to the API.
Breadcrumbs represent the path into an HTML document for a given element and will be familiar to those who navigate around a document in the browser development tools.
Breadcrumbs always start with HTML as the start of the path, will list every ancestor of a given element, and include the element itself as the last segment in the path. The HTML Processor introduces a few ways to use these:
It’s possible to search for this structure by supplying array( 'breadcrumbs' => $breadcrumbs ) inside a call to next_tag().
The get_breadcrumbs() method reports the entire breadcrumb array from HTML to the matched element.
The matches_breadcrumbs( $breadcrumbs ) method indicates whether the matched element can be found at the given breadcrumbs.
Using the example above, it’s possible to search for images that are direct children of a DIV.
Properly handling this structure comes with additional costs, so the HTML Processor cannot provide the predictable performance that the Tag Processor can. It should still be fast enough to use though when rendering a blockBlockBlock 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.’s output.
One important note about using the HTML Processor is that it’s a work-in-progress and only supports a subset of allowable HTML. If it encounters a tag or a specific kind of HTML it doesn’t support, then it will abort processing to avoid corrupting your content. The HTML Processor reports if it gave up with the get_last_error() method. Currently, there’s only a small set of HTML that the HTML Processor supports, so don’t be surprised when it aborts before finding the tag you’re looking for. Each WordPress release will expand this support until it can read all possible HTML documents.
if ( $processor->next_tag( 'breadcrumbs' => array( 'figure', 'img' ) ) ) {
// The tag was found in the HTML document.
do_something_to_img();
return $processor->get_updated_html();
}
if ( null === $processor->get_last_error() ) {
// The tag was not in the HTML document.
} else {
// It was not possible to determine if the tag was in the HTML document.
}
For more complicated queries, the matches_breadcrumbs() method can be used inside a next_tag()loopLoopThe Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop.. The * value is a special wildcard term. It only matches one of any tag, so if no open element exists in its place then the match fails.
while ( $processor->next_tag( 'IMG' ) ) {
// Skip images that are already inside a FIGURE element.
if ( $processor->matches_breadcrumbs( array( 'FIGURE', 'IMG' ) ) ) {
continue;
}
// Only process images that are great-grand-children of a BLOCKQUOTE element.
if ( $processor->matches_breadcrumbs( array( 'BLOCKQUOTE', '*', '*', 'IMG' ) ) ) {
do_something_to_img();
}
}
The HTML Processor is a subclass of the Tag Processor and so retains all the underlying methods to read and modify the HTML. In the future, it will be possible to insert and remove entire tags and to read and modify the inner markup inside a tag. In WordPress 6.4, however, the only new feature is the concept of breadcrumbs.
CSS helpers for the Tag Processor
It’s been possible to search for a tag containing a specific class with next_tag( array( 'class_name' => $class_name ) ) but not possible to search for a tag containing more than one class name, or to search for a tag not containing a given class name. In WordPress 6.4, it’s possible to do this with the new has_class() method. This method does exactly what it sounds like: it reports if a matched tag contains the given class name in its class attribute.
$processor = new WP_HTML_Processor( $html );
while ( $processor->next_tag() ) {
// Skip an element if it's not supposed to be processed.
if ( $processor->has_class( 'data-wp-ignore' ) ) {
continue;
}
if ( $processor->has_class( 'data-wp-context' ) && $processor->has_class( 'active' ) ) {
// Process the context…
}
}
The has_class() method knows how to split CSS class names properly. It’s valuable to rely on this method instead of manually processing the class attribute value to avoid several common pitfalls, especially when wanting to know about the presence or absence of multiple class names.
WordPress 6.4 Release Candidate Phase: Learn or refresh your knowledge of what happens during RCrelease candidateOne 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).. Questions? Please post them in the comments.
6.4 Dev Notes: It’s been a busy time in the Make/CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress.blogblog(versus network, site)! Stay updated on the latest technical updates by checking out posts conveniently tagged with #dev-notes-6-4. Major props to dev notedev noteEach 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. authors and wranglers who have worked tirelessly to make this happen! 🎉
WordPress core is now using Playwright for all browser-based tests: e2e fans rejoice! This milestone promises improved test stability and better options for authoring tests. If you’ve been holding back while the migrationMigrationMoving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. from Puppeteer to Playwright has been underway, now is a great time to jump back in to improve Core e2e coverage.
What’s new in Gutenberg 16.8 (11 October): Check out updates to the Cover blockBlockBlock 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., Font Library, and more in this roundup of the latest release.
Release Updates
WordPress 6.4
RC 2 is scheduled for next Tuesday, October 24, 2023.
Stay in the loopLoopThe Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. with 6.4 by following:
Roadmap to 6.4 — this next major releasemajor releaseA 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. is scheduled for November 7, 2023
Additional release updates from the floor included:
A question was raised in #6-4-release-leads about removing some GutenbergGutenbergThe 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/-only packages from the next npm package update to Core.
Some 6.4 dev notesdev noteEach 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. drafts are still needed for a couple of areas, so a gentle reminder was raised to keep the official 6.4 Documentation Tracker updated with latest progress. Reach out on the Tracker for help or to the Documentation release group in the #6-4-release-leads channel.
WordPress 6.3.2
WordPress 6.3.2 – Maintenance and Security release: This follow-up to 6.3.1 introduces several bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. fixes and security updates. Make sure to update!
@webcommsatasked if Core would consider utilizing an automated messaging/workflow tool similar to that used by Training. When users joined the channel, they would receive a private message from Slackbot that includes channel-specific info and links, such as the Dev Chat schedule, or orientation for new contributors and contributor days. Abha agreed to draft a proposal to seek broader input from Core and new contributors.
Use of noopener noreferrer in New Window/Tab Links
@presskopphad a question regarding use of rel="noopener noreferrer" in links with target="_blank", which were supposed to have been removed. To help resolve instances where this unneeded behavior remains (in Core and Gutenberg), contribute to TracTracAn open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress.ticketticketCreated for both bug reports and feature development on the bug tracker.#53843: Remove adding of rel=”noopener” to links with target=”_blank”.
WordPress 6.4 comes with several enhancements to the wp_get_loading_optimization_attributes() function which was introduced in 6.3 as a central place to manage loading optimization attributes, specifically for images and iframes.
Quick recap: Loading optimization attributes are those such as loading="lazy" or fetchpriority="high", which can be added to certain HTMLHTMLHyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. tags to optimize loading performance in the browser.
Simplified complex logic
The logic of the wp_get_loading_optimization_attributes() is generally quite complex, as it caters for several factors that influence when to apply certain loading optimization attributes. When the function was originally introduced, it was particularly hard to follow, since it included lots of early returns as well as closures. This was mostly due to maintaining its original code paths that came from the deprecated wp_get_loading_attr_default() function as much as possible to avoid breakage.
While the function logic is still complex in WordPress 6.4, it has been notably simplified, taking a more sequential and thus easier to follow approach. This facilitated the implementation of further enhancements such as those outlined below.
Please refer to TracTracAn open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress.ticketticketCreated for both bug reports and feature development on the bug tracker.#58891 for additional details on these changes.
Managing the decoding="async" attribute
The decoding="async" attribute has been present on images by default since WordPress 6.1 (see Trac ticket #53232). As of WordPress 6.4, the logic for applying the attribute has been consolidated in the wp_get_loading_optimization_attributes() function, as the attribute is a perfect fit for that function.
Deprecated function
As part of that change, the wp_img_tag_add_decoding_attr() function has been deprecated, as its logic is now incorporated into wp_img_tag_add_loading_optimization_attrs(). Unless you are using the now deprecated function in your code, no changes should be needed after this update in regards to the decoding="async" attribute. The change merely enables control over the attribute in a more consistent manner (also see the new filters introduced below).
If you are using the deprecated function and want to use a fully backward compatible replacement, you can implement a custom wrapper function such as the following:
function myplugin_img_tag_add_decoding_attr( $image, $context ) {
global $wp_version;
// For WP >= 6.4.
if ( version_compare( $wp_version, '6.4', '>=' ) ) {
$image = wp_img_tag_add_loading_optimization_attrs( $image, $context );
// Strip potential attributes added other than `decoding="async"`.
return str_replace(
array(
' loading="lazy"',
' fetchpriority="high"',
),
'',
$image
);
}
// For WP < 6.4.
return wp_img_tag_add_decoding_attr( $image, $context );
}
Please refer to Trac ticket #58892 for additional details on these changes.
New filters to control loading optimization attributes
With WordPress 6.4, two filters have been added to wp_get_loading_optimization_attributes() which allow modifying or completely overriding the logic used to apply the loading optimization attributes:
The wp_get_loading_optimization_attributesfilterFilterFilters 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. can be used to modify the results from the WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. logic.
The pre_wp_get_loading_optimization_attributes filter can be used to use entirely custom logic and effectively short-circuit the core function by returning a value other than false.
Below are a few examples on how these two filters could be used.
Filter usage examples
You could use the wp_get_loading_optimization_attributes filter to ensure a specific image within post content receives the fetchpriority="high" attribute while other ones do not:
You could implement entirely custom logic in a pluginPluginA 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 detect which images appear in the viewport using client-side JavaScriptJavaScriptJavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. logic or an external service and replace the function’s default logic with that:
function override_loading_optimization_attributes( $override, $tag_name, $attr, $context ) {
// Bail if another filter callback already overrode this.
if ( false !== $override ) {
return $override;
}
// Use custom logic to determine whether image is LCP and whether it appears above the fold.
if ( 'img' === $tag_name ) {
$is_lcp = custom_function_to_detect_whether_image_is_lcp_element( $attr );
$in_viewport = custom_function_to_detect_whether_image_is_above_the_fold( $attr );
/*
* Always add `decoding="async"`.
* Add `fetchpriority="high"` only to the LCP image.
* Add `loading="lazy"` to any image below the fold / outside the viewport.
*/
$loading_attrs = array( 'decoding' => 'async' );
if ( $is_lcp ) {
$loading_attrs['fetchpriority'] = 'high';
} elseif ( ! $in_viewport ) {
$loading_attrs['loading'] = 'lazy';
}
return $loading_attrs;
}
return $override;
}
add_filter(
'pre_wp_get_loading_optimization_attributes',
'override_loading_optimization_attributes',
10,
4
);
Please refer to Trac ticket #58893 for additional details on these changes.
Support for custom context values
As explained in the 6.3 dev note for the wp_get_loading_optimization_attributes() function, initially it only supported specific context values used by WordPress core. This made it confusing to write custom code making use of that function as you would have been forced to use a context string used elsewhere in core in order to get the performance benefits.
This limitation has been addressed in WordPress 6.4: The function now supports arbitrary contexts, and for the most part does not apply context-specific optimizations. There are two exceptions to this which are the “template_part_header” and “get_header_image_tag” contexts. Images within these contexts will always be interpreted to be in the headerHeaderThe header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes.. The list of these two context strings is filterable with a new wp_loading_optimization_force_header_contexts filter, which allows images with other contexts to be always assumed to appear above the fold.
Context filter usage example
Below is an example: Assume that your plugin has a particular header image rendering function where it is safe to assume any image rendered with that function appears above the fold. You can rely on an arbitrary context specific to your function and then force WordPress core to consider images with that context to appear above the fold.
Your image rendering function then needs to call wp_get_loading_optimization_attributes( 'img', $attr, 'myplugin_special_header' ) for the above filter to take effect.
Please refer to Trac ticket #58894 for additional details on these changes.
Hook priority change for wp_filter_content_tags()
The wp_filter_content_tags() was originally introduced in WordPress 5.5 as the foundation for lazy-loading as well as other optimizations for certain tags in a content blob. More recently a problem was identified that the function is called earlier than do_shortcode(), which means that any images added by shortcodes will not be able to make use of the performance benefits from wp_filter_content_tags().
To address that limitation, the hook priority with which wp_filter_content_tags() is hooked into the various filters (“the_content”, “the_excerpt”, “widget_text_content”, and “widget_block_content”) has been changed from the default 10 to 12. For context, the do_shortcode() function has hook priority 11.
While this is technically a breaking change, careful consideration and research across the WordPress plugin directory went into this decision. No plugins in the directory are affected by this change, given that there is only limited direct usage of the wp_filter_content_tags() function, and such usage has not been specific to the core filters. Still, in case you use the wp_filter_content_tags() function directly in your code, you may want to double check that this hook priority change does not result in a problem.
If your plugin processes custom content with the wp_filter_content_tags() function, it is encouraged to call that function after parsing other content such as blocks and shortcodes. The core change will not cause problems if that is currently not the case in your code, however it is recommended to have your custom logic follow a similar order.
Please refer to Trac ticket #58853 for additional details on these changes.
You must be logged in to post a comment.