The WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. development team builds WordPress! Follow this site forย general updates, status reports, and the occasional code debate. Thereโs lots of ways to contribute:
Found a bugbugA bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority.?Create a ticket in the bug tracker.
In this post, you will find dev notesdev noteEach important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. for smaller changes to the editor in WordPress 6.3.
Table of contents
Post editor iframed
From WordPress 6.3 on, the post editor will be iframed if all registered blocks have a Block API version 3 or higher. Adding version 3 support means that 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. should work inside an 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., though the block may still be rendered outside the iframe if not all blocks support version 3.
It is worth noting that the Site Editor and Page Template Editor have always been iframed, alongside block and pattern previews, and will continue to be iframed regardless of the Block 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. version.
To make adoption easier, all assets (styles and scripts) added through theย enqueue_block_assetsย PHPPHPThe web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher action will now also be enqueued for the iframe. For more details, seeย #48286.
Itโs also worth noting that enqueue_block_editor_assets should not be used to add stylesheets for editor content. Please use enqueue_block_assets instead. If you donโt want styles to load on the front-end, you can use an is_admin() condition.
For backward compatibility, we will clone stylesheets added via enqueue_block_editor_assets if the stylesheet contains a .editor-styles-wrapper, .wp-block, or .wp-block-* selector, but a warning message will be logged. You should use enqueue_block_assets instead, or block.json if youโre adding block styles, theme.json for block-based themes, or add_editor_style() for classic themes.
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 developers are asked to make blocks compatible with the iframed methods and support version 3 and to report any problems with those changes. In a future version of WordPress, the editor content will load within an iframe regardless of the Block API version.
Props to@ellatrixย for the dev notedev noteEach important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase..
Publish types for plugins packages enabled
TypeScript developers appreciate having great in-editor type-hints and compiler warnings. With the changes for WordPress 6.3, contributors reduced the reliance on DefinitelyTyped, and increase code maintainability. Various wordpress packages were published to allow TypeScript to emit types by parsing the JSDoc comments.
With some small tweaks to assist its inference capabilitiescapabilityAย capabilityย is permission to perform one or more types of task. Checking if a user has a capability is performed by the current_user_can function. Each user of a WordPress site might have some permissions but not others, depending on theirย role. For example, users who have the Author role usually have permission to edit their own posts (the โedit_postsโ capability), but not permission to edit other usersโ posts (the โedit_others_postsโ capability)., TypeScript can generate extensive type definitions even for store objects without migrating much code to TypeScript. So far, the following packages are using this process now:
Allow dragging-and-dropping images from the inserter to image blocks
The updates to theย onDragStartย prop of theย <Draggable>ย component switched the synchronous callback function from an asynchronous one. Previously, it used to be called asynchronously with a slight delay set byย setTimeout(onDragStart, 0). The previous behavior posed a limitation as users were unable to add additional data for the drag event due toย security measures implemented by web browsers.
This change should have minimal impact on existing code. However, if it does affect your code, you can maintain the original behavior by wrapping your event callback inside aย setTimeoutย function as shown below:
New slot in the site editorโs Template 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.
Extenders can now add additional information in the site editorโs Templateย sidebar. With the new slot namedย PluginTemplateSettingPanel the information will appear below the main information, similar to below example of the Template Card. (See Code Example)
Block Transformsย is theย APIย that allows aย blockย to be transformedย fromย andย toย other blocks, as well asย fromย other entities.
From now on, via the optionalย transformsย key of the block configuration, blocks can use theย ungroupย subkey to define the blocks that will replace the block being processed. These new blocks will usually be a subset of the existing inner blocks, but could also include new blocks.
If a block has anย ungroupย transform, it is eligible for ungrouping without the requirement of being the default grouping block. Theย UIUIUser interfaceย used to ungroup a block with this API is the same as the one used for the default grouping block. For the Ungroup button to be displayed, you must have a single grouped block selected, which also contains some inner blocks.
ungroupย is a callback function that receives the attributes and inner blocks of the block being processed. It should return an array of block objects.
Block Variations is the API that allows a block to have similar versions of it, but all these versions share some common functionality. Each block variation is differentiated from the others by setting some initial attributes or inner blocks. Then, when a block is inserted, these attributes and/or inner blocks are applied.
From now on, variations with a scope: transform will be prioritized in the block switcher menu so that they are easier surfaced in existing user interface (UI) patterns. Noting that the existing UI in the blockโs inspector controls regarding the variation transformations is preserved as is.
In this PR, we added a way to control what blocks are shown in the block inserter for a particular block. This allows a block to suggest particular blocks which are going to be most useful.
For example, when inserting a block within the Navigation block, we specify core/navigation-link and core/navigation-link/page as these are the most commonly used inner blocks.
prioritizedInserterBlocks is a property of the InnerBlocks component. To use it, pass prioritizedInserterBlocks as a property of the options argument passed to useInnerBlocksProps.
prioritizedInserterBlocks takes an array of the form {blockName}/{variationName}, where {variationName} is optional.
As a result, the blocks you specify in prioritizedInserterBlocks should be the first ones in the block inserter:
Reusable blocks have been renamed to Patterns in WordPress 6.3. For backward compatibility, the default behavior of ย core/blockย remains exactly the same as with Reusable blocks. The block content is still saved to theย wp_blockย CPT and any changes to the block content are reflected across all instances of the block. This default behavior of the Pattern block is referred to in the UI as โsyncedโ.
The Pattern block also has a second option in 6.3 which is โunsyncedโ. When โunsyncedโ, the block will behave the same as the existing theme and plugin patterns, i.e. the patterns blocks will be inserted as standalone blocks, and any edits affect only that instance.
In order to track the synced and unsynced status, a new postmeta field has been registered for theย wp_blockย CPT calledย wp_pattern_sync_status. If this postmeta field is undefined, the pattern is considered synced, and if the pattern is unsynced, this will be set toย unsynced. Because this is a coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. field, it is exposed as a top-level field in 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/. instead of aย metaMetaMeta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress.ย property, so it will appear on theย wp_blockย asย entity.wp_sync_status.
Because the synced Patterns do not require the new postmeta field, we donโt anticipate any impact on plugins that may modify the existing reusable block behavior. The only impact we anticipate is on any plugins that manipulate the DOM based on selectors that depend on the textย Reusable block(s)ย existing in the UI. These selectors would need to be adjusted to expect the textย Patternย instead.
In WordPress 6.2, we introduced a new modal for creating templates. This modal presents the option to start a new template from a โblankโ state or use the current fallback of the template. In WordPress 6.3, we expanded this modalโs functionality to display patterns that are suitable for a given template.
For a pattern to appear in the modal, it needs to specify a property called templateTypes, which is an array containing the templates where the patterns can be used as the full content.
Hereโs an example that demonstrates adding a pattern to the start of a 404 template:
You must be logged in to post a comment.