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 our bug tracker.
Since the image lazy-loading feature was originally added to WordPress core in 5.5, by default every post content image as well as every image rendering using the wp_get_attachment_image() function (which includes featured images) is lazy-loaded. This optimization follows the typical implementation of the feature in other projects, without consideration for whether an image appears above or below the fold. Due to the available metrics at the time it was decided to leave fine-grained control over opting out certain images from being lazy-loaded to theme authors, since the position of images heavily depends on the current theme layout. See also the following paragraph in the original announcement post:
Theme developers are recommended to granularly handle loading attributes for images anytime they rely on wp_get_attachment_image() or another function based on it (such as the_post_thumbnail() or get_custom_logo()), depending on where they are used within templates. For example, if an image is placed within the header.php template and is very likely to be in the initial viewport, it is advisable to skip the loading attribute for that image.
Omitting the loading attribute on certain elements
As mentioned before, WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. is unable to reliably assess whether an image is going to appear above or below the fold, since it depends on the currently active theme. Furthermore, the loading attributes are added on the server-side, which has no notion on the influencing client factors like viewport size. Because of those reasons, fine-grained control over lazy-loading images (and iframes) still remains with theme authors. However, we can fine tune WordPress core’s lazy-loading implementation to behave in a way that improves the situation for the vast majority of cases, to achieve better LCP values out of the box.
Now, one could argue that lazy-loading should be entirely removed again to avoid any negative impact on LCP. However, that would also remove all the benefits that lazy-loading comes with, which is reducing bandwidth and wasting fewer networknetwork(versus site, blog) resources, which in itself can impact Core Web Vitals (CWV) metrics. The preferable default behavior here would be to find a solid middle ground between those trade-offs. This leads to the following goal for the WordPress core implementation:
The first “x” content image(s) should not be lazy-loaded by default, with “x” being as high as possible so that there is little to no LCP 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. and as low as possible so that there is little to no regression in the total bytes loaded.
(Note that this also includes iframes, but they are less commonly used as hero elements, so for simplicity this post mentions primarily images.)
To determine the right value for “x” (i.e. the number of images/iframes to omit from being lazy-loaded by default), I conducted an analysis using two versions of a small prototype 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 which prevents the loading=”lazy” attribute from being added to the first 1 or 2 content images respectively. The analysis relied on the following methodology:
Test across the 50 most popular themes according to the wordpress.orgWordPress.orgThe 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/ popular themes search
Test on a demo site without any plugins active (except for the lazy-loading prototype plugin), for an archive view with 5 posts (where every post has a 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.) and for a single post view (where the post has a featured image as well as 5 images within its content), i.e. 2 different types of URLs
Test for 2 viewports, “mobile” and “desktop”
Use WebPageTest for the individual scenarios (200 in total), with 9 test runs for each scenario in order to counter variance and rely on the median result
That analysis produced the following results:
Omitting the first content image from being lazy-loaded resulted in a median LCP improvement of 7% (1,877ms compared to 2,020ms with current core behavior) and a median image bytes increase of 0% (368KB compared to 369KB with current core behavior). → Omitting the first content image clearly results in an LCP improvement while not noticeably regressing on image bytes saved.
Omitting the first two content images from being lazy-loaded resulted in a median LCP improvement of 5% (1,927ms compared to 2,020ms with current core behavior) and a median image bytes increase of 2% (378KB compared to 369KB with current core behavior). → Omitting the first two content images produces worse results for both metrics than only omitting the first one, i.e. it is better to only skip lazy-loading for the first content image, and therefore no additional tests with larger numbers of images not being lazy-loading are needed.
Both fixes actually perform even better in LCP compared to the results with lazy-loading completely disabled. This confirms that completely disabling lazy-loading is not a solution to the problem.
Drilling further into the results for omitting the first content image, 42% of scenarios result in a median LCP improvement of greater than 10%, with the maximum improvement being 33%. 5% of scenarios result in the median LCP being more than 10% worse, with the maximum here being 21%. → While the median LCP improvement across all themes is only 7%, there are larger notable wins for a significant number of themes, while notable losses are minimal.
Following up on the findings on the LCP regression from lazy-loading as well as the analysis about the potential fix, the following refinement to the lazy-loading implementation in core is being proposed for WordPress 5.9:
Instead of lazy-loading all images and iframes by default, the very first content image (also considering featured images) or content 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. should not be lazy-loaded.
This is a more sensitive default than what the current implementation uses, that on average and at scale will result in better LCP performance out of the box, while keeping necessary bandwidth low.
Despite this change of the default behavior, responsibility for fine grained control of which elements should be lazy-loaded remains with theme authors. As a theme author, you are still recommended to specify a loading attribute value for images presented by the theme. Particularly pay attention if your theme relies on less standard layouts, e.g. a grid or slider view of posts or if post content only appears far down the page.
A 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. for adding this enhancementenhancementEnhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. to core has been opened in #53675 for further review and discussion.
In preparation for the final release of WordPress 5.8 on July 20, 2021, an RC 4 has been packaged and released to fix some late-discovered blocking issues. The following changes have been made since RC 3:
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: BackportbackportA port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. fixes targeted for WordPress 5.8 RC4 ([51445] for #53397).
Media: When resizing, WebP images set the compression to “lossy” by default. It Fixes 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. where the compression was set to “lossless” when the uploaded WebP images have extended file format (VP8X) ([51437] for #53653).
Media: Fix JSJSJavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. error in Media Library when infinite scroll enabled ([51441] for #53672).
Media: Document edge cases with the new image_editor_output_formatfilterFilterFilters 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. ([51444] for #53667, #53668, #35725).
Privacy: Ensure the copy button actually copies the suggested privacy policy text ([51433] for #53652).
Widgets: Prevent widgets unintentionally being moved to the inactive 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. ([51439] for #53657).
@ryelle observed that a small subset of custom-properties are getting used very often, noting “…while it feels like a lot of variables to be adding, we also use the same concepts in many places”. For example:
@ryelle clarified that it’s added from a SASS mixin in base-styles and she thinks its there to allow each package to be standalone
We agreed that it does feel somewhat redundant when multiple packages are used together. Possibly it’s something that could be improved in future with coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. custom-properties
CSSCSSCascading Style Sheets. Link Share / Open Floor
@ryelle shared a comment on the CSS deprecation ticketticketCreated for both bug reports and feature development on the bug tracker. (#53070) that she wants to reply to. This led to a discussion about CSS deprecation which covered some of the following:
A wider discussion about CSS backwards compatibility needs to happen
Some kind of tooling might help to address the issue
In the ticket comment, @tellthemachines comments that, as moving redundant CSS into a deprecated.css file doesn’t offer a performance boost, it would be simpler to move it to a /* Deprecated */ section at the end of its file. @colorful-tones disagreed, noting that it deprecated.css existed it could be dequeued for a performance boost. @ryelle asked what would then happen if you installed 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 that uses a deprecated style
@colorful-tones agreed with JJJs comment, adding that “Plugin developers need to keep up with changes. If their plugin breaks then it is on them to update.”
@ryelle noted that the deprecation issue centres more on “elements that don’t exist in core anymore but a plugin could be using that markup & expecting the CSS to just be there”
@colorful-tones observed that multiple deprecation paths might be needed for the various sources of CSS, which @ryelle summarised as theme CSS (the Twentys styles), wp-admin CSS (all the files in wp-admin/css and wp-includes/css) and 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/ CSS (“technically a subset of wp-admin CSS but also its own thing”)
@colorful-tones expressed support for the approach recommended in the TracTracAn open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticket: “Create deprecated.css and perhaps even start appending --deprecated-5.8 to classes that are deprecated.”
Three items of 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/ news:
And there’s a late-breaking dev note that pertains to the editor 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..
If 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 your jam, the Core JS team is changing its office hours.
And, the mobile teams would really like you to test their respective 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. releases, for iOS here and for Android here.
Upcoming release: 5.8
A final schedule reminder: we’re in the RC period, with a hard string freeze. RC 4 is slated for Thursday, July 15 at 16:00 UTC (Ed. note: basically now, at this writing) and final release in FIVE DAYS on Tuesday, July 20.
@sergeybiryukov reported in for Build/Test Tools: they’re working hard to modernize the WordPress 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. suite with tickets #53363 and #53491.
Open floor
@francina used the last ten minutes of the chat to go back to @Arnold W. K.’s questions and give more context about how the Core team does things.
She also asked first-time attendees how they happened to find their way to the channel.
This is the agenda for the upcoming CSSCSSCascading Style Sheets. meeting scheduled for Thursday July 15 at 21:00PM UTC.
The meeting will be held in the #core-css channel in the Making WordPress SlackSlackSlack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/..
Housekeeping
Discussion: Custom Properties (#49930) Continue discussing the workflow for adding Custom Properties to coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress..
Open Floor + CSS Link Share
If there’s any topic you’d like to discuss, please leave a comment below!
Big celebration for all the hard work there with 107 issues in the Done column. There are a few new items listed but, with an RC4 coming tomorrow, anything that cannot be completed today will likely need to wait for 5.8.1. Both @desrosj and @youknowriad noted this for the group. Don’t let this stop you from testing and finding bugs but do let this set expectations!
Monthly Priorities & Key Project Updates
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. based WidgetWidgetA WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user. Editor
Work continues to focus 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. fixes and building out this refinement overview issue post release.
Navigation Block & Navigation Editor
Many of the folks working on these projects have been out on vacation to relax, get time away from screens, and get inspiration from the wider world.
Template editor
Work is mainly focused on 5.8 bug fixes/testing.
Patterns
The Pattern Directory is still underway with plans to go live when 5.8 does. You can see the latest in this milestone here.
Styling
The focus continues to look out for fixing bugs that are backported to the Betas/RC.
Mobile Team
Done:
Users can now set the text and background colors on blocks.
Mobile Gallery Block Refactor (PR) done, waiting on web side now.
Started work on supporting GSS Font Settings and specific text color settings.
In Progress:
Breakthrough on the Block Picker Search blocking issue, wrapping up the project soon.
Embed block about to ship a first iteration of the block.
Further investigations for the iOSiOSThe operating system used on iPhones and iPads. share extension project.
Still heavily focused on end user documentation in order to get the major new features covered (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., Widgets editor, Block pattern directory, Preferences, etc).
Running a hallway hangout today for the #fse-outreach-experiment (all are welcome!) and have been testing 5.8 everyday over the last week+ to find some bugs.
Would it be possible to shadow 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/ Release process? Raised by @vcanales.
Attendance at the CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress.JSJSJavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. Office hours has been low for the last few weeks so at the most recent chat those that were present decided that we’d move to a bi-weekly cadence for now. Here’s a quick summary of what is happening:
Core 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/. office hours will be bi-weekly at the same time slot (15:00UTC) with the next meeting happening July 27th.
Whenever there is something requiring more attention, the suggestion is to schedule a dedicated meeting for interested parties to gather together in the #core-jsSlackSlackSlack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. channel to have the discussion.
A reminder that the #core-js channel and office hour chats are intended to cover JavaScript across all of WordPress core, all JavaScript infrastructure, tools that build, lint, or test JavaScript code and higher-level discussions about coding styles, libraries used, etc. So has some distinction (even though there can be some overlap) from the kinds of discussions that happen within the #core-editor Slack instance which focuses predominately on 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/ project and its implementation within WordPress.
RC 2 released last week and RC 3 yesterday, now under hard string freeze
Email to 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/theme authors on 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. went out last week
No further 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 scheduled, so please highlight issues of concern directly in #core
5.8 release in SIX days on Tuesday, July 20th
Components check-in and status updates
5.8 plans and help needed
Check-in with each component for status updates.
Poll for components that need assistance.
Open Floor
Do you have something to propose for the agenda, or a specific item relevant to the usual agenda items above?
Please leave a comment, and say whether or not you’ll be in the chat, so the group can either give you the floor or bring up your topic for you accordingly.
This meeting happens in the #core channel. To join the meeting, you’ll need an account on the Making WordPress Slack.
Welcome back to a new issue of Week in CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress.. Let’s take a look at what changed on TracTracAn open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. between July 5 and July 12, 2021.
49 commits
44 contributors
67 tickets created
28 tickets reopened
62 tickets closed
Please note that the WordPress Core team released WordPress 5.8 RC 2 last week. Everyone is welcome to help testing the 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. of WordPress 🌟
TicketticketCreated for both bug reports and feature development on the bug tracker. numbers are based on the Trac timeline for the period above. The following is a summary of commits, organized by component and/or focus.
Code changes
Build/Test Tools
Add assertions to ensure version-controlled files are not modified during CI, and fix the grunt clean command – #53606
Replace assertInternalType() usage in unit tests – #53491, #46149
Use caching built into actions/setup-node – #53584
Correct comment formatting in inc/block-patterns.php – #53359, #52627
Update 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. patterns to match the latest versions of core/* blocks – #53617
Remove inline comment that is not relevant in WordPress Core – #53576
Remove wrapping HTMLHTMLHyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. tags from translatable strings – #53359
Rename the $ID variable to $user_id in wp_insert_user() and wp_update_user() – #53359
CustomizerCustomizerTool built into WordPress core that hooks into most modern themes. You can use it to preview and modify many of your site’s appearance settings.
Skip animations when they have no duration – #53562, #53542
Documentation
Correct the @sincetagtagA 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.) for the user_erasure_fulfillment_email_headersfilterFilterFilters 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. – #44314, #53461
Some documentation improvements for wp_check_widget_editor_deps() – #53437, #53569
Update the IRCIRCInternet Relay Chat, a network where users can have conversations online. IRC channels are used widely by open source projects, and by WordPress. The primary WordPress channels are #wordpress and #wordpress-dev, on irc.freenode.net. link from Freenode to Libera.chat – #53590
Editor
Merge conflicting wp.editor objects into single, non-conflicting object – #53437
Fix for 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.: color.duotone and spacing.units should allow empty sets – #53175
Update packages with latest fixes for 5.8 RC2 – #53397
Update packages with latest fixes for 5.8 RC2 – #53397
TinyMCE: ensure initialization runs in all cases on ‘interactive’ and ‘complete’ readyState. Fixes a rare 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. when the init code is inserted in the DOM after the page has finished loading – #53632
Translate _doing_it_wrong() messages in wp_check_widget_editor_deps() – #53437, #53569
MultisitemultisiteUsed to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site
Log error/warnings/notices from ms-files.php – #53493
Posts
Allow the list of wrapper blocks to be filtered – #53604
Prevent an empty excerptExcerptAn excerpt is the description of the blog post or page that will by default show on the blog archive page, in search results (SERPs), and on social media. With an SEO plugin, the excerpt may also be in that plugin’s metabox. when groups and nested column blocks are present – #53604
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/.
Add the $request parameter to methods checking permissions – #53593
Ensure a 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.’s widgets property is a list – #53612
Script Loader
Update jQuery version to 3.6.0 following the update in [50520] – #52707
Users
Return earlier from wp_update_user() in case of error – #53627
Widgets
Use wp_sidebar_description() to retrieve a sidebar’s description – #53646
Widgets
Warn when wp-editor script or wp-edit-post style is enqueued in widgets editor – #53437, #53569
WordPress 5.8 brings several additions and tweaks to 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. editor 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..
Contextual patterns for easier creation and block transformations
We’ve all been there. Staring at a blank page sometimes with an idea of what you want to create; often with a mind as blank as the page. To make the creation process easier, there is now a way to suggest patterns based on the block being used. This is now implemented for the Query block and includes some coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. patterns to start with.
In addition, there is an API to suggest pattern transformations that are contextual to the currently selected blocks. So how this is different to the patterns current behaviour? Previously, patterns insert demo content that must be updated after insertion. With this feature, it’s possible to use some patterns and retain existing attributes or content.
So it’s for existing blocks!
An important thing to note here is that a pattern transform can result to adding more blocks than the ones currently selected. You can see this with an example like the below where we have a Quote block but the pattern consist of more blocks:
This is the first iteration of the feature that covers most simple blocks (without innerBlocks). A new experimental API has been created where we can mark what block attributes count as content attributes. You can see more details in the PR.
In the long run as this work continues and spreads to more blocks, it will be easier to create content and get inspired without leaving the editor.
Pattern Registration API
if you’re creating your own custom block patterns, there’s a new blockTypes property that will allow your patterns to show up in other contexts like the transform menu. blockTypes property is an array containing the block names.
In WordPress 5.8, core blocks toolbars have been updated and made more consistent across blocks by splitting them into 4 areas like shown in the following screenshot.
To do so a new group prop has been added to the wp.blockEditor.BlockControls component. Third-party block authors are encourage to use this prop in their block code to follow the core blocks design pattern.
You must be logged in to post a comment.