The WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. development team builds WordPress! Follow this sitesite(versus network, blog) 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.
The Difficulty: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/ development happens on GitHubGitHubGitHub is a website that offers online implementation of git repositories that can 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/, instead of on TracTracAn open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. (which allows for “needs-privacy-review” to be added to the workflow of any ticketticketCreated for both bug reports and feature development on the bug tracker.). This makes it very difficult for other teams to keep up with changes that have a potential significant impact on their team. The Gutenberg repository is huge and it is simply not possible for those working on smaller teams to keep up with all issues / PRs while trying to run their own teams and dealing with other responsibilities.
Other Solutions We Have Considered: We have considered subscribing the #core-privacy channel 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 GitHub. The rest-api channel did this, but it leads to some flooding and does not work when labels are added later on (which would usually be the case with privacy).
So What Do We DO? All triagetriageThe act of evaluating and sorting bug reports, in order to decide priority, severity, and other factors. volunteers on the Gutenberg repository on GitHub should please consider whether a particular issue touches on any of the following. If it does, the issue should not proceed / the PR should not be committed, before the Privacy team has been given a meaningful opportunity to consult. If you find such an issue, please post a link here, so we can have a look. Please also makemakeA collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). use of the #core-privacy channel on Slack if you need our help. We rely on the Gutenberg triage volunteers’ assistance in this matter.
Issues / PRs that are considered to affect privacy:
1. If the issue / PR suggests that an external call should be made from the sitesite(versus network, blog) owners’ WordPress installation to any other external site (whether PHPPHPThe web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 / 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.), even if this site is 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/;
2. If an account with a third party would be needed in order to utilize any functionality (basically SaaS – I do not expect that this is likely to happen, but I am including it here for the sake of completeness);
3. Calls to any APIs (including, but not limited to calls to external APIs for the purposes of updates);
4. Use of any remote assets (e.g. images / JavaScript libraries / fonts hosted elsewhere);
5. Any cookies are proposed / use of local browser storage, or similar;
6. If the editor proposes to write any information to the DB (other than content like posts explicitly generated by the user);
7. If new Custom Post Types are proposed;
8. If new custom tables are proposed;
9. If any PPI (Protected Personal Information) may be stored;
10. If any e-mails will be sent by the code;
11. If there will be any advertisements in wp-adminadmin(and super admin) (again, not something I think is likely, just including it for completeness);
12. If any backlinks are requested (again, probably unlikely for Gutenberg).
Please also report any items not listed here, which you think may affect the privacy component.
Thank you for your co-operation and transparency in this matter.
Edit: 7/28/2020: Previously, this feature included filters to modify the environment type and available environment types. These were removed in [48662] as the function is called too early for any plugins to properly hook into these filters. This post was updated to remove mention of those filters appropriately.
WordPress 5.5 introduces a new wp_get_environment_type() function that retrieves a sitesite(versus network, blog)’s current environment type. This allows 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 and theme authors to more easily differentiate how they handle specific functionality between production and development sites in a standardized way.
By default, this function will return production. Other values supported by default are development and staging.
Below is an example of how this new function can be used to determine a site’s environment type.
switch ( wp_get_environment_type() ) {
case 'development':
do_nothing();
break;
case 'staging':
do_staging_thing();
break;
default:
do_production_thing();
break;
}
Of course care should be taken with this kind of functionality to test all the possible routes. Keep in mind that site owners and hosts are are always free to add more types as necessary.
Setting the environment type
There are two ways to set the environment type for a site. They are processed in the following order with each sequential option overriding any previous values: the WP_ENVIRONMENT_TYPEPHPPHPThe web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 environment variable, and the WP_ENVIRONMENT_TYPE constant.
For both of them, if the environment value is not in the list of allowed environments, the default production value will be returned.
The simplest way is probably through defining the constant:
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
Note: When development is returned by wp_get_environment_type(), WP_DEBUG will be set to true if it is not defined in the site’s wp-config.php file.
Specifying approved environment types
Similar to setting the environment type, there are two ways to specify approved environment types. They are processed in the same similar manner as setting the type above with each sequential option overriding any previous values: the WP_ENVIRONMENT_TYPES PHP environment variable, and the WP_ENVIRONMENT_TYPES constant.
Assume a site wishes to support a test environment type. Below is an example of defining the constant:
All hosts that support setting up staging environments are requested to set this feature to staging on those staging environments. Similarly we ask all developers with development environments to set this value to development appropriately.
Plugin and theme developers should also add support for this feature and adjust functionality appropriately based on the specified environment.
For reference, see the related ticketticketCreated for both bug reports and feature development on the bug tracker. on TracTracAn open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress.: #33161
This is a recap of the 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/.CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. chat held on Tuesday, July 21, 2020, 14:00 UTC. You can read the full meeting discussion here in Slack.
If you have an item you would like to discuss at the next meeting, please add it to the next agenda document.
A number of 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
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 posts related to what’s coming in WordPress 5.5 (for 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 and JavaScript were shared this week). I thought it’d be handy to group them all together in this week’s issue of the roundup.
The Dashicons library receives it’s final update in WordPress 5.5. If you’re using it in any products, it will still be available in WordPress, however its good switch to using the @wordpress/icons package instead (if suitable).
The register theme feature API is landed. This allows custom theme features to be registered and exposed on the theme features support REST endpoint.
In WordPress 5.5, images will be lazy loaded by default. Some great work here in preventing layout shifting.
An overview of all that is landing in WordPress 5.5 around Block Patterns.
New and modified REST API endpoints landing in WP 5.5. Includes notes on: wp/v2/block-types, wp/v2/plugins, wp/v2/block-directory, wp/v2/media/10/edit, block renderer route changes, and majority of theme 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. information is now being returned on the wp/v2/themes endpoint.
There are also some REST API Paramater and JSON Schema changes coming. In particular, the work that has gone into improving the options for more defined schema’s is sweet.
createInterpolateElement is landed. This is particularly useful for translationtranslationThe process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. string interpolation in ReactReactReact is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/. components.
The WPTavern covers GutenbergHub’s Copy and Paste Block Library. I think a earlier iteration of this surfaced in a previous issue of the Roundup. While clever, it seems to me this sort of things would work best as a pattern library using the new Pattern api in the Block editor.
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) team meeting notes from July 10th were published.
Edit: 7/23/2020: A note was added to makemakeA collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). developers aware that one of the option keys renamed prior to 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 was renamed again after beta 3 to avoid confusion with 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. – @desrosj
In version 5.5, WordPress will see several changes aimed at maintaining a welcoming environment for all contributors while improving the clarity and inclusivity of the codebase. This is a separate but related effort to a recent proposal to update the default branches for all of the project’s GIT repositories.
The WordPress open sourceOpen SourceOpen Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included, by keeping communication free of discrimination, incitement to violence, promotion of hate, and unwelcoming behavior.
Whitelist and blacklist are terms that specify allowed and disallowed or blocked things. However, many times when these two words are used, what is being allowed or blocked is not clear. This ambiguity can make for poor readability, and can also make it harder for non-native English speakers to understand the purpose of the variable, or how to properly translate a string.
In WordPress 5.5, these words have been removed from CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. and only remain where absolutely necessary for backwards compatibility. A large percentage of the occurrences existed within inline documentation and the names of locally scoped variable, but a few instances were found in function names, option keys, action/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.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., and global variables.
While most of the changes made do not require any action to be taken, a few may need some small adjustments to plugins, themes, or custom code.
Here is what you need to know!
Renamed Options
The following options have been renamed:
blacklist_keys has been renamed to disallowed_keys.
comment_whitelist has been renamed to comment_previously_approved.
Upon upgrading to WordPress 5.5, these options will be renamed as part of the normal upgrade process and no action is required.
However, when using the Options 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_option(), delete_option(), update_option(), get_option()), specifying one of the deprecated options will trigger a deprecated warning but the value for the new option name will be correctly returned.
Example
These two examples will return the same values.
$option_value = get_option( 'disallowed_keys' );
// This produces the same result, but will also trigger a deprecated warning.
$option_value = get_option( 'blacklist_keys' );
Any Options API function calls should be adjusted to look for the new option name whenever possible. For code that still needs to support support WordPress < 5.5, the following snippet will do the trick:
if ( false === get_option( 'disallowed_keys' ) ) {
// Assume this is WP < 5.5. Option does not exist.
} else {
// Assume this is WP >= 5.5
}
If disallowed_keys exists in the database, the stored value will be returned (which is an empty string by default, or a space separated list of keys and/or IP addresses). get_option() will return explicit false by default, which is a good indicator that the option does not exist.
There are a few things to be aware of, though.
Options API related filters associated with deprecated option keys will not be triggered. For example, the pre_option_blacklist_keys filter. Some basic text searches of the 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 directory found that the usage of any Options API hooks specific to the two changed option keys was almost none.
Direct Cache API calls for these options will not be reliable. For example, wp_cache_get( 'blacklist_keys', 'options ). Instead of accessing the option directly from the Cache API, get_option() should be used instead.
Queries directly modifying, updating, retrieving these options form the database will potentially cause issues. This is incorrect usage and the Options API functions should always be used instead.
Prior to 5.5 beta 1, blacklist_keys was renamed to blocklist_keys. However, to avoid any potential confusion with block editor related features or functionality, it was renamed to disallowed_keys after 5.5 beta 3. This will be fixed automatically when updating to the next development version or installing 5.5, but any code that was changed to use blocklist_keys will need to be updated once more.
In 5.6, adding a more proper _deprecate_option() will be explored to handle future occurrences like this.
For more information, see #50413 on TracTracAn open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress..
Deprecated functions
The following functions have been deprecated in 5.5. Though this should not cause any problems in your code, the following functions will now trigger a _deprecated_function() warning:
add_option_whitelist() has been replaced with add_allowed_options().
remove_option_whitelist() has been replaced with remove_allowed_options().
wp_blacklist_check() has been replaced with wp_check_comment_disallowed_list().
_wp_register_meta_args_whitelist() has been replaced with _wp_register_meta_args_allowed_list() (this is a private function, so should not be used outside of Core).
wp.passwordStrength.userInputBlacklist() was replaced with wp.passwordStrength.userInputDisallowedList() (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/.)
The following action and filter hooks have been deprecated in 5.5. Any code hooked to them will still be executed. However, a deprecated warning will now be triggered. The replacement hooks will run after the deprecated hooks.
The whitelist_options filter hook has been replaced with allowed_options.
The wp_blacklist_check action hook has been replaced with wp_check_comment_disallowed_list.
$whitelist_options has been replaced with $allowed_options.
$new_whitelist_options has been replaced with $new_allowed_options (more information below)
A scan of the plugin directory showed that only 2 plugins are explicitly accessing the $whitelist_options global and performing no modifications.
A second scan of the plugin directory showed a small number of plugins with a low amount of active installs potentially manipulating the value of $new_whitelist_options. However, it was enough to require consideration.
Because of this, the new $new_allowed_options variable is now passed by reference to the old $new_whitelist_options variable.
Unless a plugin is intentionally destroying this global variable and recreating it from scratch, this will create a seamless transition to a more inclusive name until a standardized way to deprecate a global variable can be created (such as _deprecate_global()), or the implementation can be revised to not require a global variable at all.
For more information on this change, see #50434 and #50413 on Trac.
“Webmaster”
In addition to potentially having racist undertones, the word “webmaster” has become dated and quite cryptic. One person managing all aspects of a sitesite(versus network, blog) is, for the most part, no longer the norm. The term has also become ambiguous, potentially referring to anyone fulfilling any of the following duties involved with managing a website: web architects, web developers, site authors, website administrators, website owners, etc..
The two occurrences of this string have been replaced with alternatives that better communicate who is being referenced.
WordPress 5.5 Upcoming ReleaseReleaseA release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software.
WordPress 5.5 Beta 2 and WordPress 5.5 Beta 3 are now available with WordPress 5.5 slated for release on August 11th. This software is still in development,so it’s not recommended to run on a production siteProduction SiteA production site is a live site online meant to be viewed by your visitors, as opposed to a site that is staged for development or testing.. Consider setting up a test sitesite(versus network, blog) to help translate, test, and report bugs — all great ways to contribute.
WordPress 5.5 “Must Haves” for 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/ are found on this project board.
IMPORTANT: We are reaching the deadlines for the August release, there is still one potential package update 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. next week and a last update to 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 on CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. before the RC1 next Tuesday. @youknowriad is working on the 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
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..
@mkazPR23966 that allows 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 disable the new image editing features, just wanted to makemakeA collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). sure it gets back ported 5.5 from.
@ZebPR21427 reusable block bugfix PR I’d like to see backported to core for WP 5.5 or 5.5.1 release in need of a final review.
Monthly Plan
July monthly priorities are posted with the priority being preparation for 5.5 which will continue to be through the end of the month.
Navigation is another priority. If you’d like to stay up to date, take a look at the discussion for Issue 23915 around the Navigation block and how child blocks and markup should work.
Task Coordination
Note: Anyone reading this summary outside of the meeting, please drop a comment in the post summary, if you can/want to help with something.
PR 21427 refactor the Reusable Block edit component to use ReactReactReact is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/.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. is no longer stuck. Since it fixes some really annoying bugs in master, I’m hoping it can be merged and backported to WP core for 5.5 (or at least a 5.5.1 release).
PR 21387 Due to recent changes in master, my PR to add color controls to the List block is no longer blocked. It now simply awaits feedback/reviews.
PR 24011 During the development of that PR, I discovered 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. which I have now opened an issue for.
Issue 470 I have started working on a PR to address the current a11yAccessibilityAccessibility (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) issues with the “Status & visibility” panel in the document settings, as detailed in this issue:
PR 24079 As a first step, I now have a related code quality PR ready for review.
PR 24024 Once that PR is merged, I’ll be able to complete this draft PR, which should improve the a11y situation:
PR 23971 Last week I created a PR to simplify the block toolbar styles and split the movers from the switcher. It is intended to prevent possible 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) regressions compared to WP 5.4 caused by the current design in master. It needs design feedback and reviews.
PR 24066 A few days ago, I created a PR to move the “Convert to regular blocks” button to the Reusable Block’s block toolbar to improve the options discoverability. It awaits reviews.
Two weeks ago, I opened an issue to discuss how to make the parent selector button in the toolbar more usable/discoverable/accessible. Shortly afterwards, I opened a PR to implement a solution. However, I’m a bit stuck now due to my attempted solution having its own design flaws. Any design efforts/feedback to provide a better solution would be very welcome.
PR 23836Give the More block an actual placeholder instead of a buggy pseudo-one.
PR 22650 Add a heading level validator to the Heading block; needs final code sanity check.
PR 21711Polish Custom HTMLHTMLHyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. block.
PR 23599 Minor bugfix for usage of transform-styles wrap function.
PR 23632 Use optional chaining and nullish coalescing instead of Lodash.get in block-editor package.
PR23222 Reminder that my PR to lighten the editor DOM of the Buttons block is still completely blocked by the current limitations of AlignmentHookSettingsProvider. Technical help is needed to proceed. My plans to fix the current confusing/half-broken state of the Buttons alignment controls rely on this PR being completed first.
wrote 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
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. about block patterns
working on more dev notes
I have a super-secret exciting project I’m excited to share later outside Core channels for the moment
Trying to find the next big thing to work on. Maybe I’ll focus on Global styles and help @nosolosw
I’m working on updating tutorials section, the Create a Block tutorial is in a good spot for beginner’s. This makes space for the older block tutorials to be intermediate features, for example InnerBlocks. So if anyone has a tutorial they’ve been itching to write and looking for a spot to publish docs\designers-developers\developers\tutorials\block-tutorial is a good spot. Feel free 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.” me for any help or questions on where/how to publish.
Issue 24029 I’ve made some suggestions for improving List View (a.k.a. Block Navigator)
Issue 23939 Iteration on a new 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. for the editor
Proposed an iteration on the new template flow. Lining up some iterations to a few aspects of it to align to other design proposals. After this, I’ll likely start in on exploring starter page templates.
Open Floor
Setting Categories
@enricosorcinelli — I’d like to put your attention to the Issue 23970 I recently opened. Core editor allows to set an empty categoryCategoryThe 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging. for a post. Quick/classic editors don’t allow it so first I think we should have to standardize auto-adding of a category when none set across the different editors. Moreover, updating a post with core editor will add again the default category (when none set) even if the user previously removed it and this IMHO looks like a bug. This happens with custom taxonomies as well PR23970 Different behavior for default category term with editors.
I haven’t found similar issue on archive so sorry in advance if it’s a duplicate and you have already experienced a similar thing. The team will take a closer look and continue conversation in GithubGitHubGitHub is a website that offers online implementation of git repositories that can 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/.
Adding Duplicate Template Parts Bug
@Zeb — I’d like to draw some attention to this Issue 22639 Adding duplicate Template Part removes both from page, can trigger clearing inner blocks in dirty state. I’m hoping someone here has the expertise (and the spare time, of course) to take a shot at fixing.
It’s a pretty big issue with the controlled InnerBlocks system that could be considered a blockerblockerA bug which is so severe that it blocks a release. for FSE. Specifically, it needs to be fixed to allow reusable blocks to be converted to that 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., which is being worked on in this PR 23601 where there was a suggestion for a solution made 3 weeks ago. The reusable blocks refactor PR 22832 would fix the longstanding toolbar-weirdness bugs that happen with reusable blocks, so fixing the controlled InnerBlocks API issue would indirectly help fix that bug as well. @annezazu noted PR 24000 in the works by @epiqueras. @annezazu will comment as a triager to help move things along and check in with him on PR 23661. @youknowriad notes there was a recent fix in useSyncBlock that could potentially be related.
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/ 8.6 has been released. Keeping with our July focuses, we’ve been working hard to get ready for WordPress 5.5 while continuing to ship various enhancements to continue to expand Gutenberg. In particular, this releaseReleaseA release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software. focuses on local UIUIUser interface improvements, performance improvements, 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. fixes. As part of this work, some of these fixes have made their way to WordPress 5.5 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. 3.
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. video position controls
The positioning of video backgrounds in the Cover block can now be adjusted. Previously, these positioning controls were available only to image backgrounds. The focal point picker and the input controls support cursor and keyboard interaction alike.
Block pattern updates: Large 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. and paragraph,Large header,Text two columns,Three buttons,Two buttons,Quote. (23858) (23857) (23853) (23849) (23848) (23881)
Enhancements
Editor: Display Sitesite(versus network, blog) Icon (if one is set) in full-screen mode. (22952)
Block Variations: Add support for finding variations using keywords. (24040)
Classic Block: Move the “convert to blocks” option from menu to own toolbar button. (23704)
a11yAccessibilityAccessibility (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): Use composite pattern to improve keyboard navigation on the inserter. (23610)
Date: Add timezone hint to post-scheduling UI. (23400)
Panel: Improve scroll view handling when expanding. (23327) (24046)
New APIs
Support disabling coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. block patterns. (24042)
MakemakeA collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). the line height and custom units theme support flags consistent and opt-in. (23964) (23904)
Image: Add the ability for 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 disable Image Editor. (23966)
Experiments
Site Editor:
Change references to section back to template part. (23765)
Post Date Block: Add style attributes and restructure the edit function. (23931)
Prevent 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/. error when using arrow navigation in URLInput. (24047)
Fix components utils export for use-update-effect. (23969)
Fix blocks dropping to incorrect position in inner block lists. (23950)
RangeControl: Adapt slider color to color scheme. (23936)
(JSJSJavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors.) Color Values: Rename brand to theme. Add fallback values. (24059)
Prevent content loss after refreshing an editor with unsaved auto-draft post. (23928)
Fix edited Classic block’s content deletion when switching to Code editor. (23927)
Fix block merging 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.. (23901)
Inserter: Order quick inserter items by frecency. (23900)
Inserter: Set quick inserter content width to 100% on screens below 782px. (23896)
Autocomplete: Fix closing slash inserter with ESC. (23859)
Inserter: Hide inserter’s block preview when searching. (23827)
Apply the reset mixin to the inserter panel. (23744)
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. controls: Add more space for German and other locales. (23738)
Block Library: Standardize post block placeholders. (23690)
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.: Block Library: Translate post block placeholders. (23774)
Fix issue where block inserted in wrong place when selection is in nested block list, but root appender is used. (23668)
Fix an issue where dragging while the page has no scrollbar results in a console error. (23666)
Link to theme-experiments repo in block-based theme documentation. (23748)
Code Quality
Refactor URLPopover to use ReactReactReact is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/. Hook. (23918)
Refactor Disabled component to use React 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.. (23917)
Allow wp-env to start without configuration. (23913)
Add support for different options in each environment. (22568)
Build: Use .min.js suffix for bundled JavaScript. (23926)
Try running the performance tests as a GitHubGitHubGitHub is a website that offers online implementation of git repositories that can 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/ action. (23818)
E2E: Remove duplicate blocks in setup file. (23981)
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/.: Check for WP5.5 and skip registering routes. (23880)
Image Editor: When editing, pass the edited image src. (23703)
Replace SEO settings nofollow toggle with rel text 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.. (23682)
Use global registry on the experimental navigation screen. (23675)
The following benchmark compares performance for a particularly sizeable post (~36,000 words, ~1,000 blocks) over the last releases. Such a large post isn’t representative of the average editing experience but is adequate for spotting variations in performance.
Version
Loading Time
KeyPress Event (typing)
Gutenberg 8.6
9.62 s
35.05 ms
Gutenberg 8.5
10.38 s
37.55 ms
WordPress 5.4
13.48 s
54.65 ms
Kudos for all the contributors that helped with the release. 👏
In WordPress 5.5, a new feature is being introduced that adds basic, extensibleExtensibleThis is the ability to add additional functionality to the code. Plugins extend the WordPress core software. XML sitemaps functionality into WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress..
While web crawlers are able to discover pages from links within the sitesite(versus network, blog) and from other sites, sitemaps supplement this approach by allowing crawlers to quickly and comprehensively identify all URLs included in the sitemap and learn other signals about those URLs using the associated metadata.
For more background information on this new feature, check out the merge announcement, or the corresponding 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.#50117.
This article explains in detail the various ways in which this new feature can be customized by developers. For example, if you are developing 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 with some similar functionality, this post will show you how you can integrate it with the core’s new sitemaps feature.
Key Takeways
With version 5.5., WordPress will expose a sitemap index at /wp-sitemap.xml. This is the main XML file that contains the listing of all the sitemap pages exposed by a WordPress site.
The sitemap index can hold a maximum of 50000 sitemaps, and a single sitemap can hold a (filterable) maximum of 2000 entries.
By default, sitemaps are created for all public and publicly queryable post types and taxonomies, as well as for author archives and of course the homepage of the site.
The robots.txt file exposed by WordPress will reference the sitemap index so that i can be easily discovered by search engines.
Technical Requirements
Rendering sitemaps on the frontend requires the SimpleXMLPHPPHPThe web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 extension. If this extension is not available, an error message will be displayed instead of the sitemap. The 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. status code 501 (“Not implemented”) will be sent accordingly.
Configuring Sitemaps Behavior
Adding Custom Sitemaps
WordPress provides sitemaps for built-in content types like pages and author archives out of the box. If you are developing a plugin that adds custom features beyond those standard ones, or just want to include some custom URLs on your site, it might makemakeA collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). sense to add a custom sitemap provider.
To do so, all you need to do is create a custom PHP class that extends the abstract WP_Sitemaps_Provider class in core. Then, you can use the wp_register_sitemap_provider() function to register it. Here’s an example:
The provider will be responsible for getting all sitemaps and sitemap entries, as well as determining pagination.
Removing Certain Sitemaps
There are three existing sitemaps providers for WordPress object types like posts, taxonomies, and users. If you want to remove one of them, let’s say the “users” provider, you can leverage the wp_sitemaps_add_providerfilterFilterFilters 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. to do so. Here’s an example:
If instead you want to disable sitemap generation for a specific post type or 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., use the wp_sitemaps_post_types or wp_sitemaps_taxonomies filter, respectively.
Example: Disabling sitemaps for the page post type
The sitemaps protocol specifies a certain set of supported attributes for sitemap entries. Of those, only the URLURLA specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org (loc) 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.) is required. All others (e.g. changefreq and priority) are optional tags in the sitemaps protocol and not typically consumed by search engines, which is why WordPress only lists the URL itself. Developers can still add those tags if they really want to.
You can use the wp_sitemaps_posts_entry / wp_sitemaps_users_entry / wp_sitemaps_taxonomies_entry filters to add additional tags like changefreq, priority, or lastmod to single items in the sitemap.
Similarly, you can use the wp_sitemaps_index_entry filter to add lastmod on the sitemap index. Note: the sitemaps protocal does not support on the sitemap index.
Trying to add any unsupported tags will result in a _doing_it_wrong notice.
Excluding a Single Post from the Sitemap
If you are developing a plugin that allows setting specific posts or pages to noindex, it’s a good idea to exclude those from the sitemap too.
The wp_sitemaps_posts_query_args filter can be used to exclude specific posts from the sitemap. Here’s an example:
add_filter(
'wp_sitemaps_posts_query_args',
function( $args, $post_type ) {
if ( 'post' !== $post_type ) {
return $args;
}
$args['post__not_in'] = isset( $args['post__not_in'] ) ? $args['post__not_in'] : array();
$args['post__not_in'][] = 123; // 123 is the ID of the post to exclude.
return $args;
},
10,
2
);
Disabling Sitemaps Functionality Completely
If you update the Site Visibility settings in WordPress adminadmin(and super admin) to discourage search engines from indexing your site, sitemaps will be disabled. You can use the wp_sitemaps_enabled filter to override the default behavior.
Here’s an example of how to disable sitemaps completely, no matter what:
Note: Doing that will not remove the rewrite rules used for the sitemaps, as they are needed in order to send appropriate responses when sitemaps are disabled.
Want to know whether sitemaps are currently enabled or not? Use wp_sitemaps_get_server()->sitemaps_enabled().
Image/Video/News Sitemaps
WordPress currently implements and supports the core sitemaps format as defined on sitemaps.org. Sitemap extensions like image, video, and news sitemaps are not covered by this feature, as these are usually only useful for a small number of websites. In future versions of WordPress, filters and 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. may be added to enable adding such functionality. For now this will still be left to plugins to implement.
New Classes and Functions
As of this writing, this is the full list of new classes and functions introduced with this feature.
Functions:
wp_sitemaps_get_server – Retrieves the current Sitemaps server instance.
wp_get_sitemap_providers – Gets an array of sitemap providers.
wp_register_sitemap_provider – Registers a new sitemap provider.
wp_sitemaps_get_max_urls – Gets the maximum number of URLs for a sitemap.
Classes:
WP_Sitemaps – Main class responsible for setting up rewrites and registering all providers.
WP_Sitemaps_Index – Builds the sitemap index page that lists the links to all of the sitemaps.
WP_Sitemaps_Provider – Base class for other sitemap providers to extend and contains shared functionality.
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
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.
The group didn’t discuss these, but @whyisjakeadded them to the announcements. Have an opinion? Add your thoughts to the comments:
WordPress 5.5 is slated for releaseReleaseA release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software. August 11th, 2020
@whyisjake stated that we are a week away from the scheduled RC
@whyisjake thanked everyone for the work in getting 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. 3 out the door
The group approved a fourth beta before 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). 1. The beta will happen on July 24th.
@afercia noted the 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) team reported regressions in 5.5 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, an issue the release squad should be made aware
Tickets and issues of concern
@afercia noted confusion with GitHubGitHubGitHub is a website that offers online implementation of git repositories that can 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/ issues that carry the bug label and @sarahricker suggested a different label.
@whyisjakesuggested a method for managing accessibility or 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. tags.
@estelaris mentioned that design triagetriageThe act of evaluating and sorting bug reports, in order to decide priority, severity, and other factors. times are wrong in the bugscrub schedule; @davidb will adjust.
A lively discussion followed that surfaced a number of issues the team will need to address as WordPress continues to grow. See the full chat here.
Component check-in and status updates
@Carike is looking for feedback on how to proceed with the Consent 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..
There will be a new About page scheduling process
@marybaum introduced and asked @abhanonstopnewsuk to share thoughts on the 5.5 release schedule for the About page
@abhanonstopnewsuk stated that for the 5.5 About page there will be an edit window from the end of this dev chat until 12pm UTC please on Sunday 26 July.
A formal schedule process for Marcomms elements is underway and will kick off in 5.6.
An updated release of the XML Sitemaps feature pluginFeature PluginA plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. is at hand:
@pbiron told the group that a change to sitemaps in coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. in 5.5 Beta 3 results in a PHPPHPThe web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 fatal when activated on a sitesite(versus network, blog) running Beta 3.
The fix for the feature plugin is already committed to its repo. @swissspidy will release the new version.
Open Floor
@ramiy announced that WordPress 5.5 string tickets are ready to review.
@estelaris will post her questions on the About page design on the ticketticketCreated for both bug reports and feature development on the bug tracker.
@carike thanked Abha and others for their improvement of dev notes.
Recently Published 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
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.
Got something to propose for the agenda, or a specific item relevant to our standard list 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.
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/. will see a lot of changes in WordPress 5.5. In an effort to explain each change adequately, a number of these were split out and covered by other 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
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..
Below are some other noteworthy changes that deserve a call out.
Discoverable REST resource links
To aid automated and human discovery of the REST API, a link was added in the <head> of the document and as a LinkheaderHeaderThe 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. to the REST route for the currently queried document in [48273].
For example, in the <head> of this post, the following <link> appears.
Links are added for post, pages, and other custom post types, as well as terms and author pages. Links are not currently output for post archives or search results.
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.
Three new functions are introduced.
rest_get_route_for_post() retrieves the route for the given post. For instance, /wp/v2/posts/1.
rest_get_route_for_term() retrieves the route for the given term. For instance, /wp/v2/tags/1.
rest_get_queried_resource_route() retrieves the route for the currently queried resource. For instance, /wp/v2/users/1 when on the author page for the user with ID of 1.
All three functions return an empty string if a REST API route cannot be determined. To convert the route to a link, pass the result to the rest_url() function.
For custom post types, only routes using the built-in WP_REST_Posts_Controller controller class will work by default. For custom controllers, the rest_route_for_postfilterFilterFilters 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 supply the correct route.
Similar logic applies to taxonomies, only the built in WP_REST_Terms_Controller is supported by default. The rest_route_for_term filter can be used for custom controller classes.
These links are output using the existing rest_output_link_wp_head and rest_output_link_header functions. As such, if API discovery has already been disabled, these links will not be rendered.
In [48112], the Link header was added to the list of exposed CORS response headers. Previously, only the X-WP-Total and X-WP-TotalPages headers were exposed which means that clients would have to manually construct the URLURLA specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org to implement pagination instead of using the prev and next Links.
In [48452], the Content-Disposition, Content-MD5 and X-WP-Nonce were added to the list of allowed cors request headers. The Content-Disposition and Content-MD5 headers allow for easier file uploading across domains by using a File/Blob object directly. The X-WP-Nonce header is allowed for making authenticated cross-origin and same-origin requests consistently.
Two filters are introduced, rest_exposed_cors_headers and rest_allowed_cors_headers to simplify the process of plugins modifying the list of cors headers.
The REST API treats routes without a permission_callback as public. Because this happens without any warning to the user, if the permission callback is unintentionally omitted or misspelled, the endpoint can end up being available to the public. Such a scenario has happened multiple times in the wild, and the results can be catastrophic when it occurs.
In [48526] a _doing_it_wrong notice has been added when a permission callback is omitted. For REST API routes that are intended to be public, it is recommended to set the permission callback to the __return_true built in function.
So for instance, this route registration will cause the following warning to appear.
The REST API route definition for my-ns/echo is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback.
If it was intended for this endpoint to be public, you could fix it like this.
When building a REST API route, it is important for the route callback (and permission_callback) to return data instead of directly sending it to the browser. This ensures that the additional processing that the REST API server does, like handling linking/embedding, sending headers, etc… takes place.
// This is incorrect.
echo wp_json_encode( $data );
die;
// And this.
wp_send_json( $data );
// And this.
wp_send_json_error( 'My Error' );
// Instead do this.
return new WP_REST_Response( $data );
// Or this.
return new WP_Error( 'my_error_code', 'My Error Message' );
After [48361], a _doing_it_wrong notice is now issued when any of the wp_send_json family of functions are used during a REST API request.
When using rest_preload_api_request any deprecation errors encountered when processing the request were silenced because the REST API handling took over as soon as the API server was booted.
After [48150], the REST API handling will only apply for actual REST API requests.