What’s new for developers? (May 2023) ![rw-book-cover](https://developer.wordpress.org/news/wp-json/social-image-generator/v1/image/1305) ## Metadata - Author: [[Justin Tadlock]] - Full Title: What’s new for developers? (May 2023) - Category: #articles - Document Note: --- tags: #WordPressUpdates #DeveloperRoundup #BlockEditor Author: Justin Tadlock Source: developer.wordpress.org Reference: [WordPress Developer Roundup - May 2023](https://developer.wordpress.org/news) date created: 2024-09-10 15:00 --- # Title: What’s New for Developers? (May 2023 Edition) ## Table of Contents: - [📝 Summary](#-summary) - [📖 Main Content](#-main-content) - [🗒️ Notes](#-notes) - [📖 References](#-references) - [🗣️ Paraphrase](#-paraphrase) - [📰 Newsletter](#-newsletter) - [✅ Action Items](#-action-items) - [🧪 Hypotheses](#-hypotheses) - [📊 Methodology](#-methodology) - [❓ Questions](#-questions) - [🔮 Future Research](#-future-research) - [💡 Implications](#-implications) - [✅ Logical Validity](#-logical-validity) - [🎯 Conclusion](#-conclusion) ## 📝 Summary: The May 2023 edition of the WordPress Developer Roundup brings attention to the latest features, fixes, and updates related to extending WordPress, focusing on the Block Selectors API, community themes, and new tools in the Gutenberg editor. Developers are encouraged to test these updates, such as improved block style customization, new templates in the site editor, and the introduction of the experimental Details block. This roundup highlights key bug fixes and documentation improvements for theme and plugin developers. ## 📖 Main Content: This edition focuses on exciting developments for WordPress developers, particularly in theme building and block development: 1. **Block Selectors API**: The Block Selectors API, available in Gutenberg 15.5 and WordPress 6.3, allows developers to customize CSS selectors used for block styles. By defining selectors in the block.json file, developers can gain fine-grained control over block styling. 2. **First Community Theme**: The Community Themes project debuted its first theme, Stacks, designed for creating slide decks. This effort invites all skill levels to collaborate on building block-based themes under WordPress.org's banner. 3. **Experimental Details Block**: Gutenberg 15.6 introduced the Details block for showing or hiding content. Developers are encouraged to test it in preparation for its broader release. 4. **Bug Fixes & Documentation**: The update addresses bugs from WordPress 6.2, including issues with attachment fields and shortcode blocks. Improvements to documentation for block development aim to make the learning process smoother for new developers. ### 🗒️ Notes: - Block Selectors API provides new customization for block styles via the block.json file. - The first community-built theme, Stacks, is now available for WordPress users. - Experimental blocks, like the Details block, offer new content display options. - Numerous bug fixes improve the developer experience, particularly for custom fields and shortcodes. - Documentation updates enhance accessibility for developers learning the block editor and WordPress API. ## 📖 References: - Justin Tadlock, “What’s New for Developers?” WordPress Developer Blog. May 2023. [Link](https://developer.wordpress.org/news) ## 🗣️ Paraphrase: 1. The Block Selectors API allows WordPress developers to have more control over the CSS selectors used in block styling. With this tool, customizing individual elements within a block becomes more efficient, eliminating the need for convoluted workarounds. 2. The first community-developed theme, Stacks, has been added to the WordPress theme directory. This project invites all levels of developers and designers to contribute, fostering a collaborative environment for block-based theme development. ## 📰 Newsletter: 📰 **What’s New for WordPress Developers – May 2023 Edition!** 🎉 In this month’s roundup, we’ve got some fantastic new tools to help you build better themes and blocks. The Block Selectors API is now part of WordPress 6.3, giving you precise control over block styling. Meanwhile, the community has launched its first theme, **Stacks**, designed for slide decks, and it’s just the beginning of many collaborative projects. Plus, check out the latest updates on the experimental **Details block**, bug fixes, and documentation enhancements. Stay ahead of the curve with all the latest updates from the WordPress developer community! 👉 [Read more here](https://developer.wordpress.org/news) ## ✅ Action Items: This roundup perfectly aligns with your goals as a Developer Advocate at GoDaddy. Embracing the new Block Selectors API can help your audience gain better control over styling in WordPress, which you can showcase in your community workshops. Highlighting the first community theme in your blogs or newsletter would also align with your focus on open-source advocacy and contributor engagement. Your career aspirations in the OSPO (Open Source Program Office) world can be further enriched by supporting collaborative projects like the **Community Themes initiative**. Encourage transparency and inclusivity by sharing these updates across the open-source WordPress ecosystem. ## 🧪 Hypotheses: 1. The introduction of the Block Selectors API will increase developers' ability to build more customized and efficient blocks with fewer CSS-related issues. 2. Community-led themes like **Stacks** will foster more collaborative WordPress development efforts, potentially increasing the number of contributors to WordPress.org themes. ### 📊 Methodology: - Conduct surveys and interviews with WordPress developers on their experience using the Block Selectors API. - Analyze the impact of community collaboration on theme development, tracking the growth of contributors and user feedback on **Stacks**. ### ❓ Questions: - How does the Block Selectors API improve the workflow for theme developers compared to previous methods? - What are the key barriers preventing more contributors from participating in community-led WordPress theme projects? ### 🔮 Future Research: Exploring how community-led theme development impacts the diversity and creativity of WordPress themes would be a valuable area of future research. Another potential study could focus on the broader adoption of the Block Selectors API and its long-term influence on WordPress block customization. ### 💡 Implications: These updates could significantly improve the efficiency of WordPress theme development while fostering a collaborative spirit within the community. The Block Selectors API’s introduction suggests future improvements in block development tools, leading to more creative and user-friendly WordPress experiences. ## ✅ Logical Validity: The article presents well-structured and evidence-based updates on new WordPress development features. The discussion on the Block Selectors API is grounded in solid reasoning, offering a clear benefit for theme developers. Similarly, the collaborative nature of the community themes project strengthens the case for fostering more open-source innovation in WordPress. No fallacies were detected in the arguments presented. The tone remains informative, professional, and focused on practical applications. The logical flow is consistent and organized, building naturally from one feature to the next. ## 🎯 Conclusion: The May 2023 WordPress Developer Roundup showcases critical updates for developers, particularly with the Block Selectors API and community-driven theme projects. These innovations are set to improve developer workflows and encourage greater collaboration within the WordPress ecosystem. Developers are encouraged to test these features and contribute to the growing community projects. - Document Tags: [[wordpress]] - Summary: The fourth edition of a monthly roundup that brings you all the latest features, updates, and fixes you need to know about for extending WordPress. - URL: https://developer.wordpress.org/news/2023/05/whats-new-for-developers-may-2023/ Welcome back, WordPress extenders. It’s time for the latest monthly roundup that covers everything you need to know to build plugins and themes on top of WordPress. If this is your first time here, this is a regular series where you can get an overview of the developments over the past month. The post only covers news that is specific to extending WordPress. Feel free to catch up with the previous editions: * [April 2023](https://developer.wordpress.org/news/2023/04/whats-new-for-developers-april-2023/) * [March 2023](https://developer.wordpress.org/news/2023/03/whats-new-for-developers-march-2023/) * [February 2023](https://developer.wordpress.org/news/2023/02/whats-new-for-developers-february-2023/) For the May 2023 edition, there is plenty to be excited about. When testing features mentioned in this post, be sure to use the latest version of WordPress trunk and at least Gutenberg 15.7. Before diving into the highlights of the past month, remember to take some time to reflect on WordPress’s history as it turns 20 years old on May 27, 2023. You can also join the official [20-day celebration](https://make.wordpress.org/marketing/2023/05/02/20-days-to-celebrate-20-years-of-wordpress-from-blogs-to-blocks/), which started on May 7, and check out the dedicated [WordPress 20th Anniversary](https://wp20.wordpress.net/) website. #### Highlights ##### Block Selectors API The [Selectors API was stabilized](https://github.com/WordPress/gutenberg/pull/46496) in Gutenberg 15.5 and will be available in WordPress 6.3. It lets you customize the CSS selectors used when your block styles are generated. This change means fewer workarounds and more fine-grained control over your block. You can now define your block’s selectors in `block.json` by setting the `selectors` object. By default, the `root` selector is your block’s generated class. You can target the root, specific features (e.g., `color`), and even sub-features (e.g., `typography` > `text-decoration`). Here is a `block.json` example of using the Selectors API: ``` { "selectors": { "root": ".your-block-selector", "color": ".your-block-selector > div", "typography": { "root": ".your-block-selector h2", "text-decoration": ".your-block-selector h2 span" } } } ``` Defining custom selectors allows WordPress to automatically generate the appropriate CSS for the block, as shown below: ``` .your-block-selector > div { color: var( --wp--preset--color--contrast ); background: var( --wp--preset--color--base ); } .your-block-selector h2 { font-family: var( --wp--preset--font-family--primary ); } .your-block-selector h2 span { text-decoration: underline; } ``` But this is just scratching the surface of what the API can do, and it should greatly simplify how you build complex blocks. For a full overview, visit the [Selectors API documentation](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-selectors/) in the Block Editor Handbook. ##### First community theme live in the directory The Community Themes project began on March 10, 2023, with over 20 members of the theming community joining [the kickoff meeting](https://make.wordpress.org/themes/2023/03/10/summary-community-themes-project-kickoff/). The goal of the gathering was to gauge interest in creating block-based themes under the official WordPress.org banner, much like the default themes that ship with core. Designers, developers, and community members have joined forces to push the project forward. [Stacks](https://wordpress.org/themes/stacks/), a theme for creating slide decks, is the [first creation to come out of the project](https://make.wordpress.org/themes/2023/05/04/stacks-the-first-community-theme/) and is now live on the WordPress theme directory. ![Two vertical slides shown with one being scrolled up to replace the one above it.](https://developer.wordpress.org/news/files/2023/05/image.png) Regardless of your level of experience, you can be a part of the project. Everything you need to know to get started is available in the [Community Themes GitHub repository](https://github.com/WordPress/community-themes). ##### Experimental Details block Gutenberg 15.6 introduced an experimental [Details block](https://github.com/WordPress/gutenberg/pull/45055) that you can use to display a summary and hide additional content. You can also opt into displaying the content by default. ![A Details and Summary element shown as an editable block in the block editor.](https://developer.wordpress.org/news/files/2023/05/image-1.png) There is an [alternative version](https://github.com/WordPress/gutenberg/pull/49808) of this block that should land in Gutenberg 15.8. Now is the time to start testing it but plan for its current markup and functionality to change. #### Plugins and tools ##### Define the allowed inner blocks for Group and Media & Text Support for an `allowedBlocks` attribute now allows you to limit inner blocks for both the [Group](https://github.com/WordPress/gutenberg/pull/49128) and [Media & Text](https://github.com/WordPress/gutenberg/pull/49981) blocks. With this change, you can further curate the editing experience for your users via custom implementations or patterns. ##### Customize the working directory for wp-env run By default, any relative paths used in `wp-env run` commands are relative to the `/var/www/html` directory. A patch in Gutenberg 15.7 adds a `--env-cwd` option that lets you [change the working directory](https://github.com/WordPress/gutenberg/pull/49908). ##### Self-closing flag check for the HTML API WordPress 6.3 will ship the `WP_HTML_Tag_Processor:has_self_closing_flag()` method for determining whether a self-closing flag is present for an HTML tag. You cannot use it to determine whether a tag itself is self-closing, only whether the flag is present in the tag’s syntax. The primary use case is for dealing with HTML foreign elements. ##### Bug fixes A bug in WordPress 6.2 prevented custom fields added via the `attachment_fields_to_edit` hook from rendering when a user uploaded an image. This has [now been fixed](https://core.trac.wordpress.org/ticket/58051) and will be backported to WordPress 6.2.1. ##### Documentation updates The Block Editor Handbook has a new and improved [landing page](https://developer.wordpress.org/block-editor/) that should help you navigate its content better. Contributors also updated several documentation pages in the handbook with the goal of [improving the learning experience](https://github.com/WordPress/gutenberg/pull/49792#top) for writing blocks: * How to Guides > [Create a basic block](https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/writing-your-first-block-type/) * Block API Reference > [Edit and Save](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/) * Block API Reference > [Metadata in block.json](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/) * Block API Reference > [Registration](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/) * Block API Reference > [Selectors](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-selectors/) * Block API Reference > [Templates](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-templates/) * Packages > [Blocks](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-blocks/) #### Themes ##### Style variations filter for the theme directory You can now begin using the `style-variations` tag in your block theme’s `style.css` file header. The theme directory recently [added it as a filter](https://meta.trac.wordpress.org/ticket/6545) for users who are searching for themes. At the time of writing, there are not yet any themes [with the tag](https://wordpress.org/themes/tags/style-variations/)—*you could be the first!* Of course, your theme needs to actually bundle at least one custom style variation to use it. ##### Create a Home template from the Site Editor Gutenberg 15.7 [added Home](https://github.com/WordPress/gutenberg/pull/47389) to its list of templates that can be created directly from the site editor. This change now makes it even easier for you to build themes from the comfort of the WordPress admin. ##### Block design tools additions and updates You can now add a [border to the Cover block](https://github.com/WordPress/gutenberg/pull/41153). This is primarily an enhancement, but you should check that the addition of `overflow: hidden` to the CSS doesn’t impact any customizations of the block. The rule was [removed](https://github.com/WordPress/gutenberg/pull/49913) and then [reinstated](https://github.com/WordPress/gutenberg/pull/50209) in subsequent pull requests. Several other blocks improved their support of various design tools: * [Embed](https://github.com/WordPress/gutenberg/pull/39384) added support for `margin` * [Columns and Column](https://github.com/WordPress/gutenberg/pull/49526) added support for `blockGap` (shown as **Block spacing** in the UI) * [Spacer](https://github.com/WordPress/gutenberg/pull/44002) now makes the theme-defined spacing presets available as options * [Time to Read](https://github.com/WordPress/gutenberg/pull/49496) lets you define the background and text colors ##### Improved minimum font size calculations An experimental patch in Gutenberg 15.7 [introduced a logarithmic scale](https://github.com/WordPress/gutenberg/pull/49707) for calculating the minimum font size for the fluid typography feature. The scale tapers out as the font size increases. You should test your theme designs to ensure that this update doesn’t negatively impact its typography. ##### Navigation fallbacks consolidated Up until Gutenberg 15.7, the logic for handling the creation and retrieval of fallback navigation menus has been problematic. The logic was prone to errors and the code was duplicated in JavaScript and PHP. A [recent patch centralizes the logic](https://github.com/WordPress/gutenberg/pull/48698#top) into a single implementation. After updating to Gutenberg 15.7, check your menus to ensure they work smoothly. ##### Bug fixes The Shortcode block UI now has [more specific style rules](https://github.com/WordPress/gutenberg/pull/49723), which should prevent your theme’s CSS from inadvertently overwriting the editing components. WordPress 6.2 added a `$comment_id` parameter to the `comment_time()` function, but it was not correctly passed to `get_comment_time()`. A [fix for the issue](https://core.trac.wordpress.org/ticket/58064) will land in WordPress 6.2.1. ##### Documentation A new [Variations section](https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#variations) is now in the Global Settings and Styles how-to guide, which explains how you can add custom styles for block style variations in `theme.json`. The [`theme.json` living reference](https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/) also now documents the `customTemplates`, `templateParts`, and `patterns` settings. ##### Noteworthy user-centric changes The Site Logo block [has an improved flow](https://github.com/WordPress/gutenberg/pull/49992) now that allows you to set, replace, and reset your logo. This brings the block version of the core feature on par with what was possible with classic themes. The template pattern suggestion modal’s grid design was replaced with a masonry layout. You should test your registered template patterns against this change and leave [feedback on the ticket](https://github.com/WordPress/gutenberg/pull/49958) if anything is broken. #### Events and resources ##### Developer Hours The [Interactivity API was proposed](https://make.wordpress.org/core/2023/03/30/proposal-the-interactivity-api-a-better-developer-experience-in-building-interactive-blocks/) in March 2023. The project’s goal is to create a better developer experience for building interactive blocks. In the past month, there were two Developer Hours sessions held to cover multiple time zones. You can watch them on WordPress.tv: * [APAC/EMEA](https://wordpress.tv/2023/04/17/developer-hours-interactivity-api-apac-emea/) * [Americas](https://wordpress.tv/2023/04/18/developer-hours-introduction-to-the-interactivity-api/) ##### Learn WordPress Three new resources have landed on the Learn WordPress site in the past month: * [Extending WordPress: common security vulnerabilities](https://href.li/?https://learn.wordpress.org/tutorial/extending-wordpress-common-security-vulnerabilities/) * [Custom post types and capabilities](https://href.li/?https://learn.wordpress.org/tutorial/custom-post-types-and-capabilities/) * [Developing with user roles and capabilities](https://href.li/?https://learn.wordpress.org/tutorial/developing-with-user-roles-and-capabilities/) ##### Developer Blog articles Three new articles were published over the past month: * [Using template patterns to build multiple homepage designs](https://href.li/?https://developer.wordpress.org/news/2023/04/using-template-patterns-to-build-multiple-homepage-designs/) * [Per-block CSS with theme.json](https://developer.wordpress.org/news/2023/04/per-block-css-with-theme-json/) * [How webpack and WordPress packages interact](https://developer.wordpress.org/news/2023/04/how-webpack-and-wordpress-packages-interact/) *Props to [@bph](https://profiles.wordpress.org/bph/) for co-writing and wrangling these resources, [@oglekler](https://profiles.wordpress.org/oglekler/) and [@kbat82](https://profiles.wordpress.org/kbat82/) for review and feedback, and [@joen](https://profiles.wordpress.org/joen/) for the Details/Summary asset.*, What’s new for developers? (May 2023), Justin Tadlock, 01h03z0c8a6bq139mj4p8zhzqd.