Recap: Hallway Hangout DataViews and DataForm Components

Last week, contributors spend an hour inย theย Hallway Hangout: Whatโ€™s next for DataViews and DataForm components (Oct 23, 2024). In this post, youโ€™ll find the recording, a summary, details, shared resources and a transcript.

Participants: @youknowriad, @oandregal, @ndiego, @doekenorg and @bph (facilitator)

Summary

Riad, Andrรฉ, and Birgit discussed with Nick Diego and the evolution and future of DataViews and DataForms in WordPress. The DataViews project, initiated a year ago, aims to create reusable components for adminadmin (and super admin) screens, enabling flexible rendering of structured data in various layouts like tables and grids. The DataForm component, integrated with DataViews, automates form generation from defined fields, supporting multiple layouts and actions. Custom views and actions are already available, and plans are being made to extend these features. The team emphasized the importance of semantic APIs and extensibility, inviting feedback and experimentation to refine these tools.

The overall focus of the demonstration was to showcase the current capabilitiescapability Aย 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). of DataViews and DataForm, as well as the plans for future extensibility and integration with the broader WordPress admin experience.ย 

The demo in detail

Riad Benguella gave an overview of the DataViews project and the motivation behind it, focusing on creating an abstraction for rendering lists of structured content. He explained the structure of the DataViews component, including the definition of fields (e.g., title, author, status) and the view configuration (e.g., table layout, columns to display). He also showed the ability to customize the DataViews component, such as showing/hiding fields, sorting, and filtering. He used as examples the screens for pages, templates, and patterns in the Site Editor.ย  Showcasing the support for different layout types (e.g., table, grid) and the ability to apply actions (e.g., edit, delete) to individual items or in bulk. Lastly, he demonstrated the experimental stage of how users can create custom DataViews and save them for later use.

Riad Benguella also gave an introduction to the DataForm component and its goal of automatically generating forms and panels from field configurations. He showcased the Quick Edit experiment, which allows developers to create a quick edit panel without a custom UIUI User interface. He explained the plan to recreate the Document Inspector functionality using the generic DataForm component. Via the Storybook site, he demonstrated how it can be used to develop and showcase reusable DataForm components.

Along with the example of defining a set of fields (title, order, date, author) and using the DataForm component to render the corresponding form, he also discussed plans to provide a set of default field types (e.g., integer, text, date) with auto-generated functionality like sorting and validation.

The goal is to provide a robust, extensibleExtensible This is the ability to add additional functionality to the code. Plugins extend the WordPress core software., and consistent data management experience across the WordPress admin, empowering both coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. and pluginPlugin A 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 to build more modern and user-friendly interfaces.

Additional topics

Attendees also discussed additional topics:

  • Extensibility APIs:
    • Registering custom layout components for DataViews
    • Registering custom fieldCustom Field Custom Field, also referred to as post meta, is a feature in WordPress. It allows users to add additional information when writing a post, eg contributorsโ€™ names, auth. WordPress stores this information as metadata. Users can display this meta data by using template tags in their WordPress themes. types and controls for DataForm
    • Allowing developers to override default field rendering and behavior
  • Conditional Logic in DataForm: Implementing a rules engine to support conditional field visibility and behavior based on user input
  • Integrating with Custom Post Types: Allowing seamless integration of DataViews and DataForm with custom post types so they can be used throughout the WordPress admin
  • Expanding DataViews Across the Admin: Replacing existing admin screens, like the Post List, with the new DataViews component
  • Serializable Configuration: Ensuring the configuration objects for DataViews and DataForm can be serialized to PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher, enabling server-side registration and rendering
  • Feedback and Collaboration:ย 
    • Actively seeking feedback from the community to finalize the APIs and make them publicly available
    • Collaborating with plugin developers to address their specific needs and use cases

Takeaways of the event

  • All feedback around DataViews and DataForm components from plugin authors and agency developers will be welcome
  • There is a need for testing the experiments with the custom views and post data views features in the GutenbergGutenberg The 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/ pluginย 
  • An appeal to contribute to the discussion around adding support for conditional logic in the data forms component

Resources shared:ย 

Props to @ndiego and @oandregal for review of the post.

#hallway-hangout


Transcript AI supported

0:00
Put on this computer. So yeah, we are here for the hallway Hangouts. Whatโ€™s next for data views and data form component? My name is Birgit Pauli-Haack, and we have Riad Benguella and Andrรฉ Maneiro to talk to us about the data views and the data forms component. Also wanted to just remark, we are not going to talk about any WP drama here. If you have any questions there, this is not the venue for it or the place for it. And we have also an announcement, if you want to there is the Rome core. Days are coming up in November, 8 and ninth in Rome, where itโ€™s about core contributing and developing. And those who who want to contribute to core doesnโ€™t have to be programming, though, and both, all three of us, Riyad Andrea and I, will be there, so we can kind of meet up there as well, if you want to. Is there anything else you want to announce before we kind of head into things? Anne, so itโ€™s up to you. Riad, yeah, I hand it over to you and take it away.

1:16
Thanks. Birgit, hello. Iโ€™m Riad, developer on the Gutenberg Project. Iโ€™m gonna start talking about data views. Iโ€™m gonna start sharing my screen, and Iโ€™ll walk you through all the stuff that we were working on and some history, some context about the project. So the project started, like, about a year ago, Iโ€™ll say, when we started looking at the admin redesign. And so we looked at the different screens in WP admin, like the Post List, we have like taxonomies, we have forms and we have settings. And what we noticed is that most of these screens have something in common. Basically, they are screen that either render list of data or screens that need some kind of form to add data or to edit data. So to avoid creating all these screens ad hoc as we advance in the admin redesign, we decided to take an approach where we start to thinking about an abstraction around the screen. So like, this is not something new. This is like something that exists and people have thought about for a long time. But basically all these screens can be represented by thinking about them as UI on top of structured content. So for example, a post is a structured content. It has a title, it has a description, a status, etc. And then you have a generic component that says, render a list of posts or render a form for posts or things like that. So usually people call these like features APIAPI An 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. or JSONJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. schema renders or things like that. So the idea there was, how can we implement these generic components, but without disrupting everything that without solving everything from scratch, is a big ask. So we started by taking a look at the site editor as a way to iterate on these step by step. At that time, when we started, we already had a template list in the site editor. We also had template parts and patterns, and we and we also, we were starting to work on the pages section of the site editor, but it was fairly new. And so for all these three items, we we had the room to iterate and build this reusable component and so and so. The way we started was like, Okay, letโ€™s take a look at the pages list. We want to show a list of pages, so letโ€™s define the structure of a page. And from there, we could say, Okay, I have the structure of page. I have the list of fields of my page. For example, I have the author, the title, the description, the status. And now I want to show these on a table, and which columns should I show on the table? So I have two main structures, the list of fields, and what we call a view is a description of the list itself. Like I want to the view could be something like the type of view is table. I want to render these fields like Title, Author status in this page. And I want to. To filterFilter Filters 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. this list by the published for example, the published pages, etc. So all these represent an object that is called a view object, and the user can actually tweak that view object here, like if you take a look here, I can this. Can choose which field to show, which fields to hide, the sorting, the order and things like that. And this also adapts to the different layouts of the Data View. So for with the same view, I can switch just the layout type and render something completely different. As I said, we had templates that we wanted to show, the actual templates, and we had pages where we wanted more something more classic, like a table. So with the same component, you can switch the layout, and it just renders the same data, the same structure data with a different layout. But each layout can also have additional configuration that is specific to this layout. Letโ€™s take a look at the grid. For example. You can actually define the Preview Size, which is specific to the grid, and things like that. So this component is built in a very, letโ€™s say, extensible way. Itโ€™s basically composed of two structured objects that anyone can alter, add fields, remove fields, add layout types you can imagine in the future. This is this being used as as a base for the workflow phase of WordPress, for example, a calendar plug in or something like that. Could add a layout that is the show the different posts on a calendar or on a timeline, and actions like to approve or do workflow stuff like that. So, yeah, thatโ€™s about it for the data views, one of the this is already shipped. So whether I just show you these are like the data views for pages, the data views for templates as well. It uses the grid by default, as as you can see, and the data views for patterns as well. All these three pages, they support multiple layouts. For the page, we also support the list. This is a simple list data view, and for each item, for each layout, they also we also support actions. So let me talk a little bit about actions. So as I said, we have a list of items. So each item, you can apply actions to it. And so an action is basically a callback that receives the current item that is selected or applied, and it does something about it. For example, I can remove this. The move to TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. here is an action. The edit is an action. The view is an action, and the actions can support bulk editing by default. So if I select multiple items, you can see that I have three items selected, and I have the move to trashTrash Trash in WordPress is like the Recycle Bin on your PC or Trash in your Macintosh computer. Users with the proper permission level (administrators and editors) have the ability to delete a post, page, and/or comments. When you delete the item, it is moved to the trash folder where it will remain for 30 days. action that is here. This is the exact same action that applies to one it applies to multiple elements at the same time. So thatโ€™s what we have. Thatโ€™s what we shipped at the moment, but at the same time. I donโ€™t know if you if thereโ€™s any question, feel free to stop me or anything. Iโ€™m happy to take questions and discuss these things, but if not, I can continue and show you what we have in progress. We have multiple experiments now in projects related to data views, one of them is the ability to create custom views. For example, letโ€™s say I want to create a view page by admin. So I want to show a list of stages. Maybe I want a table instead, and I want to filter this list for with the author is admin. So every time someone comes here, creates a custom view, and I can save my custom view if I refresh the page. Now my custom view is here. So this is basically you can create admin pages as you wish. Later down the road, we want to allow the ability to actually customize also the menu, so you could create custom views and say, This is the most important views for me. I put it in a dashboard or something like that. So, yeah, this is an experiment, not sure exactly when it will land when on WordPress core, but you can try it now by going by installing the Gutenberg plugin and enabling the custom views experiment. So as I said. We have three experiments that arenโ€™t going the second one is more related to admin redesign. So we are planning to advance and implement data views everywhere. As I said in the beginning, the post list here is basically a data view. The Categories list is the same thing. So we are iterating to our seeing whether we can use data views to replace these things. So you can enable an experiment in Gutenberg called the post data views experiments. This is very early, so itโ€™s very buggy and stuff, but just want to show you what we were doing. So if you click on this post page, itโ€™s actually the post list using a data view. So this is my post list. I can open the post editor, make some changes, go back to my list as also support custom views and default views provided by WordPress, just like the pages database.

10:59
This is still very early. Obviously, we cannot just replace this one. We still need categories, tags. We need extensibility to open extensibility. But yeah, thatโ€™s another experiment that is ongoing. And the last one, which I think is very interesting, actually a big project, is about the data forms. So data forms is, letโ€™s go back to the site editor, to the page, to the table. So here we have a list of pages. As I said in the beginning, we have fields that define what the page is, so we can easily generate, letโ€™s say, forms or panels to be able to edit these things, like to recreate the Quick Edit functionality we have in doubt the admin and so if You see here, I have another experiment that is enabled, which is called Quick Edit experiment. I can open this Quick Edit panel. I can select a page and make modifications here right away. So itโ€™s like a Quick Edit. The interesting thing here is that this panel is actually not a custom UI. The idea is to be able to generate these automatically from the fields. And as you can see here, it showed like the panel, because the goal, like the design goal, is to be able to recreate what we have in the editor here, what we call the Document Inspector. Itโ€™s the exact same thing we want to recreate with this generic data form component, but also the same data form component has what we call layouts, just like the Data View, so you can use it to generate regular form. An example of this, I can show you on the this is the story book. If you donโ€™t know what storybook is, itโ€™s a tool we use to develop reusable components and to show them and to show how we can use them. We have stories for both data views and data form. I can open the data form one itโ€™s here. So as you can see here, I can show you the code maybe first. So this is the code for that data form, story. Iโ€™m defining a list of fields, like a title. This is list of pages. So Iโ€™m defining the title the order a date I can like, this is random fields, basically an author just add a label for a field, a type, and some configuration, like, for example, the available elements or things like that. And then the next thing is to define what we call a form object. Itโ€™s just a simple JSON object where you can say, I want to render these fields in my form. I use the component here, data form. I pass my form object. I pass my data and the field so the structure configuration and it generates this form automatically, like I donโ€™t have to recreate this UI manually, and if I want to, as I told you, we support multiple layouts for forms, so I can switch here for to a panel if I wanted. And this is the exact same form, but rendered as a panel. This is what we use for the quick end experiment. So guess thatโ€™s it for our current work. We are iterating right now. On this. So this is our main focus at the moment, like data form and Quick Edit, but Yeah, happy to take questions address whatever is related. Thank you.

15:20
Yeah, yeah. Well, itโ€™s a, itโ€™s a hangover from the from the pandemic. So I have two questions, and I put them in the chat. So one is, it was, itโ€™s very exciting for me to kind of see that, because all of a sudden all the admin stuff really opens up to new development and to looking so much more modern, and helping a user doing all that what they need to do now, which is a thatโ€™s probably a 10 year old interface, right? Yeah. So one of the first questions that I had when you were looking for the well, going through the different layouts, like a table layout, the grid layout, are there any ideas on how to add additional layouts for that? Like you, you mentioned a calendar. Thatโ€™s not possible right now to add a calendar as a layout function there.

16:20
So, yeah, itโ€™s itโ€™s not open. The API is not open because we are still iterating, and we donโ€™t want to rush into opening an API that is not ready. But it is built in a way that adding layout is definitely something that we want, like itโ€™s a possibility. Basically, you can think about it as a layout is a component, a ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org component, your register, and it takes a list of items that your data. And it takes also the configuration, like the available fields, what I donโ€™t know, what the description of each field, the label of the different field, lecture, and you can actually render the list the way you want, exactly. So itโ€™s just a separate, generic component. And yeah, at the moment, itโ€™s not possible to register this, but this is definitely one of the extensibility APIs that we want to offer. As I said, I didnโ€™t mention too much extensibility, like when I was showcasing but there we are. We built this to be able to, like, extend it in all ways possible. So the basic way is adding and removing fields, right? So you want to add a field and you want to remove it. But there are also other things we thought about, like adding actions. You can add an action, you can add a bulk action, you can remove an action. The other extensibility API is at the form level. Like you can say my feed title. I donโ€™t want to use the regular string data type to be able to edit the title. I want to use my separate control that is a select box, or then Iโ€™m going to fetch titles from a lot of places, and like using the REST APIREST API The 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/, or something like that, just coming up with stuff. But this is also an API that we want to offer registering controls. Letโ€™s see like field types, okay, right? And the other one that you mentioned is layouts. Yes, layout is an important one. Like, through, like, you can imagine, like, Canva and layout, or like a calendar or a thing. Like, it shouldnโ€™t be that hard, like it just registration based API. So, yeah, at the moment, itโ€™s more like about the timing. I weโ€™re not sure yet when we will think like a data views API is stable enough. You can already use it in your plugins, because itโ€™s an NPM package. So you can install the NPM package in your plugin and bundle like in your own pages and things like that. What you can do yet is hook into the existing data views that are in core and, like, add your own fields and things like that. But this will come, like, fairly soon. Yeah.

19:11
So

19:12
about extensibility Ria, if I might just say something. Can you talk a bit about how you think about sensibility in terms of, well, you wrote and published a post recently about some of our practice, and you mentioned semantic sensibility. And I think the actions showcase is a good example of how you know about this, how you raise your own action. And it shows everywhere, if you just condemn that, I think that might help people understand how you think about sensibility.

19:47
Yeah, yeah, thatโ€™s a good point. So yeah, in Gutenberg, basically, we have this principle that we donโ€™t want to when we build extensive. APIs, we have to be as semantic as we can. What that what does that mean? Exactly? It means that we donโ€™t like API that says, add the button to this area of the page. Thatโ€™s not a semantic API. Thatโ€™s an API that is very specific to the current design of this page, like if I move this side bar, for example, to a headerHeader The 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. later, or something like that. The the plugin is going to break because the API was specifically meant to render on this part of the UI, and this part of the UI doesnโ€™t mean doesnโ€™t exist anymore. Or what can this create? Is also it can create a frustration, because for core we wonโ€™t be able to actually make changes anymore to that UI, so weโ€™re kind of stuck in the UI. That might be not ideal because of some new use cases. So what we prefer is more like semantic APIs. Is like registering stuff. So when you register an action, you register something, then itโ€™s meaningful or an action. What is an action? An action is like something that can happen on an Item. An Item can be a post or a site, or like a template. So an action, whether you render it in a menu, as I showed, like in the drop down for each item of the table is gonna work the same way, whether I render it there, whether I render it into both editing tool bar in the button, or whether the grid view decide to render it on top of the of the preview, or things like that. Itโ€™s itโ€™s just gonna work regardless of how the page is being built. So, yeah, thatโ€™s the point about semantic APIs.

21:46
Thatโ€™s very interesting. Yeah. Thank you so much. So I had another question, and it might not fit right in there, but I have seen quite some feedback from people that want to create also meaningful categoryCategory The 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging. pages and what they would need So, and you were thinking that, okay, so we are going through the post datas, which is also categories and tags and all that. Are you planning to also add the blockBlock Block 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 to the description fields? When you do that to allow blocks in on those pages or content, or are you kind of more strictly? Okay, we want the text information there, rather than also block markup.

22:37
So Iโ€™m not sure, like if I understand the question probably like, people want to be able to design their categories pages as like using the block editor. So Iโ€™m not sure if that means adding block editor to the description of the categories, because a lot of people think about that. I think for me, itโ€™s more like about allowing the site editor to create templates for these categories and, like, render them properly there, which I think is kind of already possible, but maybe we like the UI is not as optimized for that, and maybe Itโ€™s just some small tweaks to allow that, yeah,

23:22
okay, yeah, no, I can see that, yeah, yeah. So any other questions that are telling me you have any questions can be, yeah,

23:33
Iโ€™ve got a question on the data, views, field types. Currently, thereโ€™s just a single field type, and they used to be an enumeration field type, but I believe thatโ€™s been deprecated in because we already have the options you can apply to the field. But I was just wondering, do you have any plans on providing like a default set of field types instead of having to register your own React component and use that instead. I

24:06
want to take this Andrea, maybe this

24:10
area Sure, I just was trying to find a link to share. So yeah, we had enumeration enum type at the beginning, but it was fairly limited. It was only for you to create a filter, so we deprecated that, and now use elements so you provide a list of values for the filter to be created for you. But we are working now on defining field types, and we have, Iโ€™m going to find the link here. We have, we have three, I believe, integer, text and date, yeah, finding the link and and the idea is this field types is that if you create a field and say, Hey, this is your type, text. It creates for you a set of functions, like the sorting is auto generated. Validation for the Quick Edit Form is auto generated, and other things, right? As a fill, also author, you will still be able to override, overwrite those definitions, right? So this is a long way to say, yes, we are working on field types. They are not yet mandatory, but we are trying to make them so, and Iโ€™m gonna find the link and share in the chat for you,

25:37
just to add something there. I think whatโ€™s important, like, and that was not mentioned before, is that we are working with the assumption and with the constraints, basically, that all these configuration objects, we want them to be serializable, like for 80% of the use cases. What does that mean? That means that, basically, ultimately, we want PHP APIs to be able to create these things like register fields and like register actions. You obviously have to register a callback, but really not actions, but most of the rendering, you should be able to do it in PHP, but for special cases where you want some special interactivity and things like that. You have to go into an override the default field types and the default renderings and provide your own components. But for most use cases, you wonโ€™t have to care about that at all. The user could, you could do it with the UI, and you could a developer can do it with PHP.

26:41
Yeah, if and if I can just share my screen just for a bit and show you my editor. This is the story that we had showed before about data form, and you see the type being used here. This auto generates all the things that the field needs for you, right? As I said, is not complete. It doesnโ€™t itโ€™s not mandatory yet, but, yeah, we are working towards having that available,

27:13
right? So, but thatโ€™s more for data forms, or, sorry, data the form of data forms, I donโ€™t know. Yeah,

27:20
itโ€™s for both, because at the end, so the fields are shared between data form and the Data View, okay, are the same so they they have, they share the same API, all

27:34
right, whatโ€™s true is that, at the moment, the field types donโ€™t offer, like, a tail or rendering, default like, for example, when you say, I have a date field type, you should expect to define the format somehow and have it rendered without having to actually write a component for it. I think thatโ€™s use case we want to address. Itโ€™s not itโ€™s not there at the moment, but itโ€™s definitely use case we want to address.

27:58
Yeah, because that was one of the things that we ran into when we want to reuse the same components multiple times or the same layout site of the column, for example, that there was no feedback on which field you were currently in. So we had to do some querying, create an extra function around it that got the field ID injector so we knew what data to get from the data source. So if there are in the Future Ways to register your own field types that can still find their own find their own data in the data source, thatโ€™s, yeah, that would be amazing.

28:37
What I havenโ€™t seen yet is and what forms always brings into my mind is, how about validation? Is that also something that is kind of built in into the API? I havenโ€™t seen it. Thatโ€™s why Iโ€™m asking.

28:54
There is actually a very light validation implementation in the data form component, but obviously, like as with everything else, what our approach there is, letโ€™s implement the use cases we need for core. Letโ€™s get some feedback from the developers and then add the features that we need. We We are certain that we need some kind of validation library built in into the component, or like something that connects with the component easily, but yeah, right, right now weโ€™re just not there. Okay,

29:35
cool. There was one question, and Iโ€™m not quite sure how the context about it that I saw on Twitter multiple times that was, is there a way to use the data views also on the front end? Right now, itโ€™s all in the admin section. But is there something that could be on the front end? Yeah. Or is there thinking about it?

30:02
I actually saw recently, like, maybe, like a week ago, an experiment of a block called connected data use block. So itโ€™s actually a table block, or, like a grid block. You connect it to a custom post typeCustom Post Type WordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept. or to a REST API that serves JSON or something like that, and it just renders in the front end that lists. You know, I think there is obviously a need for that. My small like demo was like, data views is a React component. It might be a bit heavy for some front end. So, like, in terms of vendor size and things like that, I think itโ€™s actually good for, letโ€™s say application type of website, like, you know, like some websites do, a lot of this is a list of events, or, like, people interact with them and things like that. I think it can be good for this kind of use cases, for more regular websites and things like that. I would discourage it personally, but I think itโ€™s very doable to have, like connected data form or connected data views or things like that.

31:19
Yeah, itโ€™s probably easier to just kind of read out the data in JSON and then render it through a table, table block or something like that, yeah, and build a separate component about it. Yeah, I can see that

31:32
quickly flag. I WordCampWordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what theyโ€™ve learned throughout the year and share the joy. Learn more. us. I actually talked to a gentleman about this, and he has a plug in or a site called Data kit here, Iโ€™ll just put the link in the chat. Oh, thatโ€™s you.

31:46
Yeah, you probably know security, yeah, sorry

31:53
about that. Well, there we go. I remember, yeah, exactly.

31:57
I just wanted to say that we are indeed creating a plug in currently called Data kit. You can find it at data kit.org and itโ€™s itโ€™s a PHP software develop kit around data views, and it also has a WordPress plugin. So the idea currently is that you can basically hook up any type of data source. So we have some connectors for CSV files. Since we are a gravity forms based company, we also have a Gravity Forms connector, just a plain old array could be the data source. So weโ€™re currently looking into ways to expand that. We also connected ws form for example, which basically you just create the data source, and you set up the form or the view with some PHP code. So you donโ€™t need to know any react. You donโ€™t need to know any JavaScriptJavaScript JavaScript 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. Itโ€™s just your PHP. You register it, and then you can place it somewhere with a short code or a blog. So yeah, thatโ€™s and then you can use it on the front end. It works pretty well.

33:07
Yeah, excellent, excellent. So any other questions, ideas? Yeah, we got them. I will share a few links with the recording that rihan kind of helped me put together about extensibility, about the issues on GitHub, about extensibility, the data use, the data forms, tracking issues and how quick edit works, and Data View supposed, and then the documentation link. And then I really would suggest, recommend for anybody who wants to kind of get the hands dirty with it, two articles on the Developer blog that are written by Juan Juan Margarita, and itโ€™s two parts. One is how to set up the data views on your own plugin or your own page, including how to set up a React app on your for your plugin. And the other one is how to register and execute some actions with the data views that you had. And itโ€™s actually a very nice example on on reading some images from from a third party so source, bring it in, into your admin, and then decide on the pick the pictures that you want to add to the media library. So thatโ€™s kind of a whole itโ€™s thatโ€™s a great use case that gives you a lot of big range of how to act with the data views and and for your plugin, yeah. So

34:43
go ahead, yeah. Just wanted to, like, encourage people to, like, try and give us the feedback, because we actually need the feedback. Like, we cannot release this API publicly on WordPress. We. Without proving it, because itโ€™s a very big API. Itโ€™s a very impactful API. So itโ€™s like, itโ€™s for me, in my mind, itโ€™s very similar to, like, a block API. Itโ€™s kind of same level. So I think we need, like, as much feedback as we can get there. And yeah, please do share.

35:18
Yeah, itโ€™s also a very big component. Yeah, are you having plans to kind of slice it out into smaller components, or is it something thatโ€™s it needs its complexity as a whole?

35:32
Now, thatโ€™s a good question. Like itโ€™s actually two components right now. So data format, data view, but the data view itself can be a composed component. So right now, when you render a database which renders the list, but also renders like the Filters area, it renders the configuration area, and all of these actually can be composed. We we probably will split it into smaller, composable components if you want more advanced use cases?

36:01
Yeah, I think it will be good. Yeah. Nick, did you have another question?

36:08
Yeah, this might be going beyond this conversation, but thereโ€™s just, Iโ€™m very excited about data forms, mainly because thereโ€™s so many, you know, custom plugins authors out there that have, you know, Custom Settings pages and, you know, just things that are all different, right? Theyโ€™ve all rolled their own solution for various things. And I am excited about having kind of, like, a standard solution that people can, like, adopt and use, and then everything feels very uniform. Itโ€™s not like you go to different sections of the admin and itโ€™s just looking, you know, completely different. So long term, maybe you covered this. Sorry, I arrived late. In terms of, like, a rough time frame, at what point do you all think that the admin or the site editor kind of interface will be ready to start allowing for people to add additional content types, you know, custom post types or whatever, into that, we think in like a year, two years, you know, what would be the back of the envelope? Guess?

37:26
Your feet to the fire. Yeah,

37:30
itโ€™s obviously very hard to give an answer there. What I will say that we just landed the new private API, which is gonna probably open on Gutenberg, plug into for experimentation to add new pages to the site editor. Like you can add register pages to the site editor, but like you mentioned, custom post types, I would say custom post type is something that should be baked in. Like you register a custom point type. It just appears like the data used for it disappears and things like that. And about timelines, my hope is a year. Letโ€™s say this is very quiet, but itโ€™s also not, I guess itโ€™s depends on the priorities of, like, the road map and the project. Like, if we want to accelerate there, we will accelerate there. And itโ€™s just yeah, I cannot give you like, yeah,

38:31
no, I understand Yeah. From, from a from, like, a workflow perspective. Letโ€™s say youโ€™re, like a custom developer and or in plugin developer, and you want to start exploring this, but you also donโ€™t want to necessarily kind of waste time. And I mean that in that like you, letโ€™s say that you incorporate data views and data forms into your custom admin whatever. Will that work be relevant once the ad, you know, once core progresses, like, will that be able to you? Will you be able to translate that work that you did in incorporating data views, once the extensibility APIs are ready and you can bring that into, yeah,

39:19
that makes sense. It makes sense. Yeah, I think it will. So basically, just right now, if you want to build Settings pages with data forms and like these APIs, you will probably have to register a new page or new script and render that script on that page or something like that. So the difference will be instead of registering a new page, and like in PHP and like in queue, the script, your own script, you just remove the bootstrapping, but you keep the UI the same, and you just register a page into the whatever pages API we offer. But I will also say that May. It will mean, it will mean also removing code, because some of this might be abstracted even more in PHP. And you could say, okay, these are my settings, and thatโ€™s it. Do what you want with it, you know? So I think, yeah, itโ€™s probably food future proof, if you start doing today, like rendering a data form in a custom page, but it might be easier in the future,

40:28
awesome, and I think that was kind of my expectation, but I think that thereโ€™s some hesitancy among Iโ€™ll speak for myself, I have a plug in with a massive Settings page, and I need to sit down and convert it out to data form. But itโ€™s like, you know, understanding that the work that you do, putting into it, you know, is somewhat future proof, and you can migrate that once the core is ready. And so if anybodyโ€™s listening to this, start experimenting now. So youโ€™re somewhat future proof.

40:56
Yeah, we

40:57
need you to start the experiment now.

41:02
Hmm, alright, yeah. So any other things that you want, apart from get your hands dirty, get in, experiment things and yes, tell us what other field types you would need and all that that would probably help too, because right now you only have three field types here, so there might be a need for others as well. Yeah. Any other thoughts at the well, weโ€™re not at the end, but we could kind of close it here. I think it was a very good demonstration and a good discussion. Any other thoughts from read or for Andrea or so?

41:45
I have a naive question, because I have not looked into this enough, and so forgive me, but with data forms, can you have the like Iโ€™m looking at the story book now, you know, with text fields and radio and so on and so forth, can you add your add other components into that?

42:05
So, yeah. So right now the data form is you choose a layout and you you choose the fields. And we are thinking about changing that a little bit, instead of choosing the layout and choosing fields where weโ€™re thinking about for each field. You choose a layout so you can mix and match, right? So you can say, this is a regular form, this is a regular form field. This is regular form. This is a panel, which means, basically a drop down when you to open the form field. And I guess ultimately, the same way we think about registering layout for data use, I can see as opening an API to register custom layout for forms. And you could say, I want to render this in tabs, or I want to render this in like a field set, or I actually think we will probably absorb a lot of that in the component itself, like tabs and fields that feels like common enough that we should absorb them, but itโ€™s always the same approach, have the default baked in and allow registration like semantic APIs to extend it, so I think itโ€™s going to be possible. Okay, yeah,

43:25
extending, extending a bit of that that was for the layout, for the controls, is the same thing, like disconnect with the conversation we had before about types. If you provide a type for a field, it creates a control for you, but you you have a few ways to override that. You can say, hey, I donโ€™t want this control. I want this other that is also register. But what if it is not register? Well, you can create your own by providing an edit function as well. So itโ€™s the same as we had mentioned. Provide a good default, and then people can override in a variety ways.

43:59
Okay, so just to take that little further, so letโ€™s say that I have, using a real, real world example, I have in my settings page, I have, Iโ€™m using the color picker component that allows someone to, you know, choose a hex code or whatever. So in the context of a data form, is it? Would it be possible to render, for example, a color picker component?

44:32
Yes, I can share my string. So the idea is that these are the fields. And as I mentioned, you know, you provide a type, but you can also provide an a function. And this is a way to say, hey, the component for this type was an input control, I believe, but I want to show a radio here. However, you can just write here your own function component, so if you have color. Pick it wherever that you can reuse from somewhere else. You can just write here your function component and use that color picker that you wrote. We donโ€™t have that like bundle. You can say, hey, this is a color. We donโ€™t have that yet, but we can just, you just can write your own in a function. So, yeah, awesome. Very cool.

45:25
Cool. I guess I should start building something.

45:30
Yeah, the idea, the idea is that, you know, this is providing the basic plugs that we have been using in some pages in the site editor. So it doesnโ€™t aim to be super complete yet, just cover our user cases. But also, you know, letting others implement their own thing.

45:50
Yeah, absolutely. I think that thereโ€™s definitely going to be some edge cases of getting something custom, yeah, but yeah, itโ€™s cool that you can do

45:59
it. So at WordCamp cars were there was a developer from Yoast called Lars gersman, and I think you know him, and he had the idea about a Jason schema, to give an kind of a set of properties, and then automatically, kind of create the form and everything. Is that something that you have been look I know you have been looking at it, but how do you think that that actually could make it into the data user, data forms? Is it something, or is it a completely different direction,

46:43
and itโ€™s actually very related. So we actually discussed with Lars for some time. I think itโ€™s the same idea, basically, for of data form, like the JSON schema, render is the same idea as a data form. You provided a JSON schema, which is the list of fields that we have, and you provided a render configuration, which is the form object for us. So itโ€™s the same idea. There is the reason we didnโ€™t go full on JSON schema approach, because these are existing libraries that to test in schema and they donโ€™t adapt well to the data views. And we wanted to share the exact same structure, the exact same configuration between the data views component and the data form by allowing the extensibility so but yeah, itโ€™s basically the same idea, and I think we discussed with Lars and his expertise would be actually very helpful here.

47:44
Yeah, alright, cool. No, Iโ€™m looking forward to that, but it was really neat, fun from his demonstrations, yeah, but he was, his examples were a little further than Yeah, so it was very cool. Anyway, Iโ€™ll share the link to, oh the Yeah, the presentation from Laos was unfortunately in German. So I think there might be an English one out there to be a more inclusive for everybody else as well. But yeah, to kind of think about it. So Nick, you got your questions all answered that you can think of now

48:24
I was, I was hoping for them to tell me like it wasnโ€™t possible, and then I wouldnโ€™t have to go do build now that it is possible. No, I got some work to do. Yeah, so how about

48:38
you? Yeah, I have one question, will the forums support conditional logic like I want to for data kit. I want to be able to register data views so people can show them in the in the front end. And I really want to use data forms as the backing admin, because it just makes sense to create data views within data form. So just to complete the world, but one of the things that is important for us is like, if I want to have a CSV data source, for example, I want to be able to pick that first. Like, what type of data source I want CSV, and based on the selection I made. I need a different form input, like I need the media library, for example, to be able to pick the file, or I need to be able to provide a URLURL A specific web address of a website or web page on the Internet, such as a websiteโ€™s URL www.wordpress.org to an online version of that of the same file. Or if I want to provide a gram reforms data source, I want to be able to pick the form, and I want to be able to pick the fields I want to show. So, yeah. Basically, the question is, will the data forms component support these like conditional logic things,

49:55
yeah. And do we also, I was thinking of. About Next plug in as well, like block visibility, which is, I think also rules plug in, they kind of ties into that. I think thatโ€™s a good use case that youโ€™re bringing. And actually, we have also some friends from move that are bringing the same use cases to us, like, for like, they want to try data form in product editor, and they have a very similar use cases. So yeah, my hope is, yes. My hope is that we will have like, rules engine baked in into the data form component somehow. Yeah, come and help us build it.

50:39
Yeah, one thing, one thing that I can share is that I donโ€™t know if weโ€™ll cover all the cases that people mentioned about conditional, but there are some basic ones that we need to cover in terms of the form. Like, imagine the typical situation where you have a con a country input control. So depending on the value of that control, you need to show other values in other controls, like region or the city, that that kind of experience is not there yet. But yeah, thatโ€™s the kind of thing that we are hearing from, from you also, yeah, yeah. Cool.

51:13
Thatโ€™s also a use case that quite a few form plugins havenโ€™t really solved yet easily. Yeah, all right. Nick, next question,

51:24
no, Iโ€™m sorry. I was just youโ€™re done.

51:29
All right. Well, this was wonderful. I learned quite a lot. And thank you so much for the time, Maria, then Andrea, and thanks for coming to the show, Nick. And whatโ€™s your name? Again, Iโ€™m I know, but Duke, yeah, Duke was close there. And yeah, and thank you

51:50
for the pleasure. My name often, so

51:54
yeah, weโ€™ll have the recording in in a couple of days on the core make blog, including all the transcript, of course, and the links that you all shared in the chat and Well, thank you all, and you all have a great day. Was wonderful.

52:13
Thank you. Thanks. Bye.

52:16
Bye.

#dataviews, #summary

Agenda, Dev Chat, Oct 30, 2024

The next WordPress Developers Chat will take place on Wednesday at 01:00 UTC in theย coreย channel onย Make WordPress Slack.

The live meeting will focus on the discussion for upcoming releases, and have an open floor section.

Additional items will be referred to in the various curated agenda sections below. If you haveย ticketticket Created for both bug reports and feature development on the bug tracker.ย requests for help, please continue to post details in the comments section at the end of this agenda.

Announcements

WordPress 6.7 RC 2 was released on October 29. Thank you to everyone who contributed to this release and attended the release party! There is a helpful guide here on how to help test this release.

Forthcoming releases

Next major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope.: 6.7

We are currently in the WordPress 6.7 release cycle. WordPress 6.7 RCrelease candidate One 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). 3 is scheduled for Tuesday, November 5. For specific release times, review the release party schedule post.

Next maintenance release

There are no maintenance releases planned at this time.

Next GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses โ€˜blocksโ€™ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ release: 19.6

The next Gutenberg release will be 19.6, scheduled for November 6.

Discussions

The discussion section of the agenda is to provide a place to discuss important topics affecting the upcoming release or larger initiatives that impact the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Team.

If you want to nominate a topic for discussion, please leave a comment on this agenda with a summary of the topic, any relevant links that will help people get context for the discussion, and what kind of feedback you are looking for from others participating in the discussion.

Highlighted Posts

Editor updates

You can keep up to date with the major Editor features that are currently in progress by viewing these Iteration issues.

A reminder that there are a number of issues remaining on theย 6.7 Editor project board that could use help.

Open floor

Any topic can be raised for discussion in the comments, as well as requests for assistance on tickets. Tickets in the milestone for the next major or maintenance release will be prioritized.

Please include details of tickets / PRs and the links in the comments, and if you intend to be available during the meeting for discussion or if you will be async.

Thanks @annezazu for reviewing

#6-7, #agenda, #dev-chat

Whatโ€™s new in Gutenberg 19.5? (23 October)

โ€œWhatโ€™s new in GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses โ€˜blocksโ€™ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/โ€ฆโ€ posts (labeled with the #gutenberg-new tagtag A 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.)) are posted following every Gutenberg release on a biweekly basis, showcasing new features included in each release. As a reminder, hereโ€™s an overview of different ways to keep up with Gutenberg and the Editor.


Gutenberg 19.5 has been released and is available for download!

This release focuses on stabilizing existing features but also brings some improvements to the general UIUI User interface and the zooming editing experience, with 116 PRs from 47 contributors.

  1. Smoother Zoom in/out experience
  2. Other notable changes
  3. Changelog
  4. First-time contributors
  5. Contributors

Smoother Zoom in/out experience

Gutenberg 19.5 most notable enhancements circle around the zooming out -and in!- experience.

For instance, the Edit button from the zoom-out toolbar has been replaced to favor more friendly interactions and reduce visual overload. Apart from the top toolbar toggle for this mode and the ability to double-click to zoom back, which were introduced in recent releases, a new Enter keyboard interaction brings you back in as well.

With all these easy ways to exit the zoomed-out view, the editor will now zoom out when showing the pattern inserter, a use case where showing a general view of your page/site matters more than focusing on individual blocks.

Moreover, this release brings many bugbug A 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 to make this feature as stable and solid as possible for the upcoming WordPress 6.7. And the zooming transition is now smoother, too!

Other notable changes

  • The editor modes writing and editing, as introduced in Gutenberg 19.4, can now be set as a user preference so that the selected mode persists even after exiting the editor or reloading the page.
  • BlockBlock Block 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. bindings can now be used on the widgets screen, too. Check out the original pull request to learn more, or keep tuned to the Developer Blogblog (versus network, site) for more comprehensive examples!
  • You might notice some icon polishing here and there, like the update to the hidden icon and the new upload and download cloud icons.
Read more: Whatโ€™s new in Gutenberg 19.5? (23 October)

Changelog

Enhancements

General interface

  • Remove the verb Toggle from the Block Inserter button. (65983)
  • Write/Design tool: Persist as a user preference. (65945)
  • Update โ€œhiddenโ€ icon to be clearer, and invert logic as used in Data Views. (65914)
  • Update cloud upload and add cloud download icon. (65906)

Zoom Out

  • Make zoom transition smoother. (66017)
  • Try zooming out when selecting the patterns tab in the inserter. (65785)
  • Update/replace edit button with enter on selection. (65760)

Global Styles

  • Improve navigation logic for revisionsRevisions The WordPress revisions system stores a record of each saved draft or published update. The revision system allows you to see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what has changed in each revision. screen. (65946)

Block bindings

  • Register bindings sources in widgets screens. (65937)

Block Library

  • Cover Block: Refactor setting panel. (65432)

Component Storybook

  • Add type tokens to storybook. (65993)
  • Storybook: Add stub doc on existing colors. (65982)

Bug Fixes

Zoom Out

  • Exit zoom out when mode is changed. (65975)
  • Fix scaling issues. (65998)
  • Fix zoom reflow by replacing border with padding. (66012)
  • Focus first section root block if no selected block and tabbing to zoom out canvas. (65843)
  • Make zoom out vertical toolbar consistent. (65627)
  • Polish zoom out inserter. (66110)
  • Position scaled htmlHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. within available container space. (66034)
  • Restores setting zoom out mode to useZoomOut hook. (65999)
  • Use consistent canvas frame spacing on device preview and zoom out. (66018)
  • Zoom layout shift: Second alternate fix. (66041)

Block Library

  • Code block: Set LTR direction for RTL languages. (65891)
  • Fix duotone on parallax/repeated featured imageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts. cover blocks. (65929)
  • Fix: Embed Block: Match HTML in the editor and frontend. (65478)
  • Hide grid visualizer when grid is template locked or block editing mode is not default. (66065)
  • Post Content Block: Fix conflictconflict A conflict occurs when a patch changes code that was modified after the patch was created. These patches are considered stale, and will require a refresh of the changes before it can be applied, or the conflicts will need to be resolved. between clearFix and focus ring in the editor. (65364)
  • Post Content: Fix display of block support styles. (66003)
  • Post Terms: Fix fatal error when โ€˜get_the_term_listโ€™ returns โ€˜WP_Errorโ€™. (65848)
  • Query LoopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop: Fix isControlAllowed and isTemplate combined logic. (65984)
  • Query Loop: Fix query type indicator. (65877)
  • Revert โ€œUpdate z-index hierarchyโ€. (66074)

Block bindings

  • Accept client ID as parameter forย useBlockBindingsUtils. (65818)
  • Allow label override when it is defined in client registration. (66160)
  • Bootstrap server sources earlier. (66058)
  • Fix: Donโ€™t render image whenย srcย attribute is empty. (66004)
  • Allow the field types matching attribute types in bindings. (66174)

Global Styles

  • Always preview style variations using desktop device type. (66023)
  • Improve Navigator usage in typography panel. (65942)
  • Leave screen if current shadow entry gets deleted. (65935)
  • PaletteEdit: Dedupe palette element slugs. (65772)
  • List all active fonts in the typography section. (65806)

Block Editor

  • Fix DropZone class names on drop. (65798)
  • Fix padding appender hook. (66143)
  • Memoize pattern objects returned from getAllowedPatterns. (66159)
  • Fix rich text toolbar corners. (66163)
  • BlockCanvas: Fix the height prop and width of the block editor. (65977)

Components

  • Fix : Secondary Button Transition. (66045)
  • Global Styles: Fix overflow caused by RangeControl tooltip. (65875)
  • ToggleGroupControl: Donโ€™t set value on focus after a reset. (66151)
  • Fix: Add missingย post.slugย dependency toย useMemo. (66125)

Interactivity APIAPI An 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.

  • Allow โ€œdefaultโ€ suffix values. (65815)
  • Correctly handle lazily added, deeply nested properties withย deepMerge(). (65465)
  • Improvements to the experimental full-page navigation. (64067)

Site Editor

  • Fix site editor back button visual regressions. (66166)
  • Zoom Out: When double clicking a template while zoomed out , reset zoom level instead of showing dialog. (65963)

CSSCSS Cascading Style Sheets. & Styling

  • Editor: Prevent wrapping text when showing icon labels in headerHeader The 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.. (66038)
  • Update z-index hierarchy. (65626)

Data Views

  • Data Views list layout: Revise for improved text truncation. (65376)
  • Fix: Pattern rendering issue. (66022)

Extensibility

  • Rename wp_register_block_template() to register_block_template(). (65958)
  • Fix: Return result from wp_register_block_template function. (66102)

Post Editor

  • Fix โ€œtypewriterโ€ spacing style application. (65885)
  • Add argument with post ID to the editor.savePost hook. (66165)

AccessibilityAccessibility Accessibility (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)

Post Editor

  • Fix metaMeta Meta 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. boxes accessibility. (65466)
  • Fix navigate regions shortcuts on the back button WP logo slot. (63611)
  • Improve PostURL terminology and accessibility. (63669)
  • Match visible label of search inputs with their actual label. (65458)

Components

  • Fixed : Modal dialog: Small improvement for elementShouldBeHidden. (65941)
  • ToggleGroupControl: Donโ€™t autoselect option on first group focus. (65892)
  • Tooltip: Add aria-describedby to anchor only if not redundant. (65989)

Typography

  • Revert the โ€œManage fontsโ€ button in Global Styles. (66107)

Performance

Interactivity API

  • Leverage scheduler.yield in splitTask when available. (66001)

Theme JSONJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML.

  • Backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. from WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.: improve performance of WP_Theme_JSON::Merge when merging background styles. (66002)

Documentation

  • Add heading level curation documentation. (66076)
  • Components: Set up README auto-generator. (66035)
  • Contrast notes: Update 4.6:1 note with further context. (66168)
  • Data-basics/4-building-a-create-page-form is ready now. (66100)
  • Docs: env: Expand examples of path syntax. (65972)
  • Updated several typos in client-assets.php file. (66084)
  • Use correct label in PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher Backport documentation. (65908)
  • add: Usage examples in core editor documentation. (63768)
  • Consistent with block-development-examples data-basics-59c8f8. (65995)

Code Quality

  • .screen-reader-text CSS update for responsive-block-control style.scss. (66145)
  • Add missing CHANGELOG entries forย #64067. (66120)
  • Button: Move to stricter lint rule for 40px size adherence. (65840)
  • Private APIs: Remove obsolete try/catch block. (65898)
  • Remove clip and -webkit-clip for block-library common.scss. (66144)
  • Remove unused select toolbar code. (65834)
  • Simplify logical expression inย InitPatternModal. (65922)
  • Theme JSON: Remove redundant check and relocate $selectors assignment. (66154)
  • Type the router package. (65854)
  • Update jsdom to 25.0.1. (65879)
  • Interactivity: Update preact packages. (66008)

Global Styles

  • Edit Site: Avoid recomputing variations when no theme variations. (66137)
  • Edit Site: Remove redundant state inย StyleVariationsContainer. (66130)

Block Library

  • Post Terms: Remove unnecessary โ€˜get_the_termsโ€™ call. (65867)
  • Query Loop Block: Remove redundant sticky state. (66126)

Block Editor

  • Cleanupย AutoBlockPreviewย render memoization ofย BlockList. (66060)
  • Use shallow memo for prioritized inserter blocks. (65737)

Components

  • Clean up Tabs animation logic. (65878)
  • SearchControl: Deprecate onClose prop. (65988)

Post Editor

  • Block Visibility: Add end-to-end test. (65880)

Zoom Out

  • Fix components coding standards in Zoom Out Toolbar. (65858)

Gutenberg pluginPlugin A 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.

  • Correct capabilitycapability Aย 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). for the Experiments page. (66118)

Tools

Testing

  • Add an end-to-end test to check the interactions in write mode. (65819)
  • Composite: Add legacy unit tests to stable version. (65952)
  • Fix end-to-end Storybook configuration. (66089)
  • Tests: Add unit tests for image rendering. (66010)
  • Zoom out: End-to-end test โ€“ zoomed out mode zooms the canvas. (65943)
  • e2e: Fix Block Visibility test. (65939)

Build Tooling

  • Dedupe npm packages. (65913)
  • Update and align babel dependencies version. (65949)
  • Update node-fetch to 2.7.0. (65957)
  • Update npm lockfile to version 3. (65923)
  • Upgrade browserslist and webcompat data packages. (65926)

First-time contributors

The following PRs were merged by first-time contributors:

Contributors

The following contributors merged PRs in this release:

@aaronrobertshawย @aferciaย @ajlendeย @akasunilย @Aljulluย @andrewserongย @AnmolVerma404ย @ciampoย @DaniGuardiolaย @dhruvang21ย @draganescuย @getdaveย @hbhalodiaย @jameskosterย @jasmussenย @jeryjย @jsnajdrย @leemyongpakvaย @MaggieCabreraย @Mamadukaย @matiasbenedettoย @matt-westย @mcsfย @mediaformatย @michalczaplinskiย @mikachanย @mirkaย @ndiegoย @ntsekourasย @ramonjdย @renathoย @richtaborย @rmccueย @sabernhardtย @SantosGuillamotย @shail-mehtaย @sirrealย @stokesmanย @t-hamanoย @talldanย @troychaplinย @tyxlaย @up1512001ย @vk17-starlordย @Vrishabhskย @westonruterย @youknowriad


Thanks to @joen for the release assets and @cbravobernal for the peer review.

#gutenberg #gutenberg-new

WordPress 6.7 Field Guide

This guide outlines major developer features and breaking changes in 6.7 and is published in the Release Candidaterelease candidate One 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). phase to help inform WordPress extending developers, CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. developers, and others.

There are more than 300 Core Trac tickets included in WordPress 6.7, 87 of which are enhancements and feature requests, and more than 200 bug fixes. This release includes 23 tickets focused on performance, 21 on accessibility, and 12 on modernizing code and applying coding standards. Changes in 6.7 are spread across 38 Core components.

This release includes 445 enhancements, 464 bug fixes, and 55 accessibility improvements for the BlockBlock Block 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 (a.k.a. GutenbergGutenberg The 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/).

Below is a breakdown of the most important developer-related changes included in WordPress 6.7.


Table of contents


Block Editor

WordPress 6.7 brings 8 Gutenberg releases into core โ€“ 18.6, 18.7, 18.8, 18.9, 19.0, 19.1, 19.2, and 19.3. As in most recent WordPress releases a large part of the updates are related to the block editor and its features.

General Updates

Design Tools

The ongoing effort to consolidate design tools has continued and several blocks now support more additional design tools.

Other

There are also a large number of other changes which have been listed in a miscellaneous block editor changes dev notedev note Each 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..

Interactivity APIAPI An 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. & Script Modules

WordPress 6.7 includes updates for the Interactivity API, such as a new way to interact with server state changes in client-side navigation. Also, script modules updates include improvements for loading existing scripts as module dependencies.

HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. API

WordPress 6.7 includes many helpful updates to theย HTMLย API. This work includes a few new features and a major improvement to the HTML Processorโ€™s usability.

I18Ni18n Internationalization, 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.

Various internationalization (i18n) improvementsย are in WordPress 6.7, including:

Performance

WordPress 6.7 also brings some new performance focused enhancements, including a new way to register blocks that uses generated PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher files to bypass performance bottlenecks of loading / parsing JSONJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. files and more.

Miscellaneous Developer Changes

Some other notable changes for developers included in WordPress 6.7 are:

Props to @fabiankaegy, and @davidbaumwald & @peterwilsoncc for review.

#6-7, #field-guide

Agenda, Dev Chat, Oct 23, 2024

The next WordPress Developers Chat will take place on Wednesday at 01:00 UTC in theย coreย channel onย Make WordPress Slack.

The live meeting will focus on the discussion for upcoming releases, and have an open floor section.

Additional items will be referred to in the various curated agenda sections below. If you haveย ticketticket Created for both bug reports and feature development on the bug tracker.ย requests for help, please continue to post details in the comments section at the end of this agenda.

Announcements

WordPress 6.7 RC 1 was released on October 22. Thank you to everyone who contributed to this release and attended the release party! There is a helpful guide here on how to help test this release.

Forthcoming releases

Next major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope.: 6.7

We are currently in the WordPress 6.7 release cycle. WordPress 6.7 RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). 2 is scheduled for Tuesday, October 29. For specific release times, review the release party schedule post.

Next maintenance release

There are no maintenance releases planned at this time.

Next GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses โ€˜blocksโ€™ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ release: 19.5

The next Gutenberg release will be 19.5, scheduled for October 23, and will include the following issues.

Discussions

The discussion section of the agenda is to provide a place to discuss important topics affecting the upcoming release or larger initiatives that impact the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Team.

If you want to nominate a topic for discussion, please leave a comment on this agenda with a summary of the topic, any relevant links that will help people get context for the discussion, and what kind of feedback you are looking for from others participating in the discussion.

Open floor

Any topic can be raised for discussion in the comments, as well as requests for assistance on tickets. Tickets in the milestone for the next major or maintenance release will be prioritized.

Please include details of tickets / PRs and the links in the comments, and if you intend to be available during the meeting for discussion or if you will be async.

Thanks @mikachan for reviewing

#6-7, #agenda, #dev-chat

WordPress 6.7 Release Candidate Phase

Now that WordPress 6.7 has entered the Release Candidaterelease candidate One 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). (RCrelease candidate One 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).) phase, the following policies are in place.

These policies mainly cover how and when CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. committers can commit. For non-committing contributors, this post may help explain why a Core committercommitter A developer with commit access. WordPress has five lead developers and four permanent core developers with commit access. Additionally, the project usually has a few guest or component committers - a developer receiving commit access, generally for a single release cycle (sometimes renewed) and/or for a specific component. makes a certain decision.

These policies cover both the GutenbergGutenberg The 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/ and WordPress-Develop repositories.

String Freeze

To allow the Polyglots teamPolyglots Team Polyglots Team is a group of multilingual translators who work on translating plugins, themes, documentation, and front-facing marketing copy. https://make.wordpress.org/polyglots/teams/ time to get their local languageโ€™s translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. of WordPress ready, no new strings are permitted to be added to the release. Existing strings can be removed and/or duplicated if needed.

Seek guidance from the Polyglots team leadership for any strings reported as buggy. A buggy string is one that can not be translated to all languages in its current form.ย In such case, another RC may eventually be released to update the related strings. This will be done in a responsible and reasonable manner, only when necessary.

Tickets on the WordPress 6.7 milestone

For the remainder of the cycle, only two types of tickets may be placed on/remain on the 6.7 milestone:

  • Regressions: bugs that have been introduced during the WordPress 6.7 development cycle, either to existing or new features.
  • Test suite expansion: tests can be committed at any time without regard to code or string freezes. This can cover either new or existing features.

WordPress-Develop Trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision. is now WordPress 6.8-alpha

WordPress 6.7 was recently forked to its own branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch"., trunk is now open for commits for the next version of the software.

Backporting to the 6.7 branch

Backporting commits of production code (that is, anything that ends up in the zip file) now requires double sign-off by two core committers. The dev-feedback keyword should be used to request a second committerโ€™s review, dev-reviewed should be added to indicate a second committer has reviewed and approved the commit to the 6.7 branch. The commit messages guidelines document how to credit committer sign off and backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. commits to WordPress-Develop.

As always if you need clarification on this process, please ask in #core-committers.

Commits to the test suite and docblockdocblock (phpdoc, xref, inline docs) changes do not require double sign-off.

Props to @ironprogrammer, @jorbin for reviewing this post prior to publication.

#6-7

Performance Chat Summary: 22 October 2024

Meeting agenda here and the full chat log is available beginning here on Slack.

Announcements

  • Welcome to our new members ofย #core-performance
  • WordPress 6.7ย RC1 is today, October 22, withย RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta).ย 2 following on October 29
  • Reminder due to daylight savings, this meeting will shift to 16:00 UTC from October 29
  • WordPress 6.7 performanceย dev notesdev note Each 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.ย published:
  • Announcing the newย #core-performance-hostingย channel where the Performance team have been invited to commence a discussion on initiatives [see Slack]

Priority Items

  • WordPress performance TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. tickets
  • Performance Lab pluginPlugin A 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 other performance plugins)
  • Active priority projects

WordPress Performance Trac Tickets

Performance Lab Plugin (and other Performance Plugins)

  • @adamsilverstein created a PR to add Wappalyzer detection for the new Web Worker Offloading plugin โ€“ย https://github.com/HTTPArchive/wappalyzer/pull/71 which was merged already
  • @benni had a question to the plugins. LCP priorization. Sometimes the LCP element on a webpage is text that uses a web font included via CSSCSS Cascading Style Sheets.. In such cases, the text can only be rendered after the font has been loaded, which can delay the LCP, I think? Would it be possible for the โ€˜Optimization Detectiveโ€˜ plugin to detect when the LCP element is text and automatically preload the font in the <head> section to improve performance? Or maybe the โ€˜Image Prioritizerโ€™ plugin could be renamed to โ€˜LCP Prioritizerโ€™ and expanded to handle this optimization for text elements as well?

Active Priority Projects

Improving the calculation of image size attributes

  • @mukesh27 As part of the improving the calculation of sizes work, Iโ€™ve started implementing the new approach to the existing work so we can easily update it with the latest changes. The PR will be open soon, but before that,ย https://github.com/WordPress/performance/pull/1623ย needs to be merged to ensure we have the latest changes on the feature branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch"..

Enable Client Side Modern Image Generation

  • @swissspidy just merged a GB PR yesterday & opened another one today, working on the next one

Enhance Onboarding Experience of Performance Lab Plugin

Open Floor

  • n/a

Our next chat will be held on Tuesday, October 29, 2024 at 16:00 UTC in the #core-performance channel in Slack.

#core-performance, #hosting, #performance, #performance-chat, #summary

Performance Chat Agenda: 22 October 2024

Here is the agenda for this weekโ€™s performance team meeting scheduled for October 22, 2024 at 15:00 UTC.

  • Announcements
    • Welcome to our new members of #core-performance
    • WordPress 6.7 RC1 is today, October 22, with RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). 2 following on October 29
    • Reminder due to daylight savings, this meeting will shift to 16:00 UTC from October 29
    • WordPress 6.7 performance dev notesdev note Each 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. published:
    • Announcing the new #core-performance-hosting channel where the Performance team have been invited to commence a discussion on initiatives [see Slack]
  • Priority items
    • WordPress performance TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. tickets
    • Performance Lab pluginPlugin A 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 other performance plugins) including:
      • Enhanced Responsive Images
      • Embed Optimizer
      • Image Prioritizer
      • Image Placeholders
      • Modern Image Formats
      • Optimization Detective
      • Performant Translations
      • Speculative Loading
      • Web Worker Offloading
    • Active priority projects
  • Open floor

If you have any topics youโ€™d like to add to this agenda, please add them in the comments below.


This meeting happens in the #core-performance channel. To join the meeting, youโ€™ll need an account on the Make WordPress Slack.

#agenda, #meeting, #performance, #performance-chat

Internationalization improvements in 6.7

Various internationalization (i18n) improvements are in WordPress 6.7, and this developers note focuses on these.

Determining whether a translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. exists

Sometimes it can be useful to know whether a translation already exists for in memory without having to first load the translation for the given text domain. The new has_translation() function allows for exactly that.

See #52696 / [59029] for more details.

Sending emails in the adminadmin (and super admin)โ€™s localeLocale A locale is a combination of language and regional dialect. Usually locales correspond to countries, as is the case with Portuguese (Portugal) and Portuguese (Brazil). Other examples of locales include Canadian English and U.S. English.

Back in version 4.7, WordPress added the ability for users to set their preferred locale. When sending emails to a user, they are always sent in that locale, and everyone else receives the email in the siteโ€™s locale.

Now, WordPress 6.7 is going a step further: every time an email is sent to the administrator email address (admin_email), WordPress checks if a user with the same email address exists. If so, the email is sent in that userโ€™s locale.

See #61518 / [59128] for more details.

Warnings if translations are loaded too early

WordPress now warns developers if they are loading translations too early in a pluginPlugin A 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. or theme, before the current user is known. Existing functions like load_plugin_textdomain() and load_theme_textdomain() were updated to defer the actual loading to the existing just-in-time translation logic in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. This reduces the likelihood of triggering the warning, and even improves performance in some situations by avoiding loading translations if they are not needed on a given page.

Reminder: if your plugin or theme is hosted on WordPress.orgWordPress.org The 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/ and is still using load_*_textdomain(), you can remove this call. Since WordPress 4.6, plugins and themes no longer need load_plugin_textdomain() or load_theme_textdomain(). WordPress automatically loads the translations for you when needed. If you still support older WordPress versions or do not host your plugin/theme on WordPress.org, move the function call to a later hook such as init.

When attempting to load translations before after_setup_theme or init, WordPress tries to load the current user earlier than usual, without giving other plugins a chance to potentially hook into the process. It also prevents any plugins from filtering translation calls, e.g. for switching the locale or file location. Hence the addition of this warning to call out this unexpected behavior.

See #44937, [59127], and [59157] for more details.

Your plugin might be _doing_it_wrong() if you for example directly call get_plugin_data() (which attempts to load translations by default) or __() without waiting for the init hook. Here is a common example that was found in an actual plugin that was fixed:

/**
 * Plugin Name: Awesome Plugin
 */

function myplugin_get_version() {
	require_once ABSPATH . 'wp-admin/includes/plugin.php';
	// Prevent early translation call by setting $translate to false.
	$plugin_data = get_plugin_data( __FILE__, false, /* $translate */ false );
	return $plugin_data['Version'];
}

define( 'MYPLUGIN_VERSION', myplugin_get_version() );

If you do not explicitly set $translate set to false when calling get_plugin_data(), the function translates the plugin metadata by default. Since this plugin just needs the version number, there is no need for translating any of the other fields.

Another example:

/**
 * Plugin Name: Awesome Plugin
 */

class My_Awesome_Plugin {
	public $name;
	public function __construct() {
		// This triggers just-in-time translation loading
		$this->name = __( 'My Awesome Plugin', 'my-awesome-plugin' );

		// ... do something
	}
}

// This immediately instantiates the class, way before `init`.
$myplugin = new My_Awesome_Plugin();

Here, a class is immediately instantiated in the main plugin file, and code within the class constructor uses a translation function. This can be avoided by deferring the class instantiation until after init, or deferring the translation call until later when it is actually needed.

If your plugin is affected by this warning, you can use code like follows to find out the code path that triggers it:

add_action(
	'doing_it_wrong_run',
	static function ( $function_name ) {
		if ( '_load_textdomain_just_in_time' === $function_name ) {
			debug_print_backtrace();
		}
	}
);

Developer tools such as Query Monitor are also helpful in situations like this.


Props to @ocean90, @fabiankaegy for review.

#6-7, #dev-notes, #dev-notes-6-7, #i18n

Block Bindings: Improvements to the Editor Experience in 6.7

WordPress 6.7 introduces various improvements to the BlockBlock Block 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. Bindings APIAPI An 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. and the built-in post metaMeta Meta 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. source, including a default UIUI User interface and the beginnings of a public editor API.

For an introduction to Block Bindings, first introduced in WordPress 6.5, see the prior dev note.

New Block Bindings UI

Compatible blocks โ€”ย which currently include Heading, Paragraph, Image, and Button โ€” have received a new default UI for viewing bindings.

Called Attributes, you can find the new tool panel in block settings whenever a compatible block is selected in either the post or site editor.

The panel shows active bindings on the current block. If there are any post meta available, the panel is also interactive, allowing you to bind attributes to those custom fields via the built-in post meta block bindings source.

Currently, there are two limitations to the panel:

  1. It will not allow users to bind attributes to custom sources just yet.ย 

    Bindings to custom sources, which can be added via the code editor or other programmatic means, will still display in the panel โ€” they just canโ€™t be connected via the UI for the moment in WordPress 6.7.

    A flexible API for connecting custom sources to the Attributes panel is currently under development and is planned for public release in the future.

    For now, the rollout of that API has started with the built-in post meta source to allow time for gathering feedback.
  2. For each attribute, the panel will only show custom fields that match its data type. For example, an attribute of type string or rich-text can only be connected to a custom fieldCustom Field Custom Field, also referred to as post meta, is a feature in WordPress. It allows users to add additional information when writing a post, eg contributorsโ€™ names, auth. WordPress stores this information as metadata. Users can display this meta data by using template tags in their WordPress themes. of type string, and an attribute of number can only be connected to another number.

New Post Meta Label Attribute

To improve how custom fields appear in the editor UI, a new label attribute has been created for post meta, which can be defined during registration:

If specified, the label will render in place of the meta key in the Attributes panel โ€” in this example, the label would replace movie_director. The label will also render under certain circumstances in other parts of the editor, including as a placeholder for Rich Text if a block is bound to the post meta source and a default value is undefined.

Usage In Custom Post Templates

One of the primary use cases for Block Bindings is to assist in creating templates for custom post types. Given a custom post typeCustom Post Type WordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept. called movie, for example, one can define how custom fields for that post type will render, such as via connected images, headings, paragraphs, and buttons.

Here is an example of how one could use connected blocks to create a layout:

One can override the content in connected blocks for each instance of the custom post type, a much simpler and more flexible way of creating layouts than in the past โ€”ย all without needing to create custom blocks.

Default Permissions

Accompanying this UI is a new canUpdateBlockBindings editor setting, used to determine whether the UI is interactive for users or not.

By default, this editor setting is set to a new edit_block_binding capability, which maps to a userโ€™s ability to either:

  1. Edit the post type (in the post editor), or
  2. Edit the theme options (in the site editor)

This means that the setting is by default set to true for administrators, and false for other users.

This default setting can be overridden using the block_editor_settings_all filterFilter Filters 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. and modifying $editor_settings['canUpdateBlockBindings'] as follows:

function my_plugin_override_can_update_block_bindings( $settings ) {
    $settings['canUpdateBlockBindings'] = true;
    return $settings;
}
add_action( 'block_editor_settings_all', 'my_plugin_override_can_update_block_bindings' );

New Public Editor APIs

Several functions have been exposed to enable the use of block bindings in the editor.

Registration API

Source Bootstrappingย 

As part of the new editor API, Block Bindings will automatically register custom sources defined on the server with bootstrapped values in the editor. This will allow existing sources registered using just the server APIs to render in the UI.

This means that any sources already registered using the server APIs, available since 6.5, will appear in the UI, at least minimally, without any action required.

For example, given the following server registration and block markupโ€ฆ

Server Registration
function my_plugin_register_block_bindings_post_attributes() {
    register_block_bindings_source(
        'my-plugin/post-attributes',
        array(
            'label'              => _x( 'Post Attributes', 'block bindings source', 'my-plugin' ),
            'get_value_callback' => 'my_plugin_block_bindings_post_attributes_get_value',
            'uses_context'       => array( 'postId' ),
        )
    );
}
add_action( 'init', 'my_plugin_register_block_bindings_post_attributes' );

function my_plugin_block_bindings_post_attributes_get_value( array $source_args, $block_instance ) {
    $allowed_fields = array( 'title', 'excerpt' );
    if ( ! in_array( $source_args['key'], $allowed_fields ) ) {
        return null;
    }
    $post = get_post( $block_instance->context['postId'] );
    return $post->{'post_' . $source_args['key']};
}
Block Markup
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"my-plugin/post-attributes","args":{"key":"title"}}}}} -->
<p></p>
<!-- /wp:paragraph -->

โ€ฆthe source will get registered in the editor with the sourceโ€™s name my-plugin/post-attributes, label, and uses_context values. This is enough for the UI to render as follows:

In this case, however, the bound paragraph in the block canvas will simply show the source label and will not be dynamic. Further customization of the editor experience requires using the new editor registration functions, detailed in the next section.

Editor Registration

The following functions have been exposed to allow customization of the editor experience:

  • registerBlockBindingsSource: Registers a source on the client (using this function will override the bootstrapped registration).
  • unregisterBlockBindingsSource: Unregisters an existing source.
  • getBlockBindingsSource: Gets a specific registered source and its properties.
  • getBlockBindingsSources: Gets all the registered sources in the client.

These are based on other registration APIs like block types, block variations, or block collections.

Source Properties

Registered sources in the client can include the following properties:

  • name: The unique and machine-readable name.
  • label: Human-readable label. Will overwrite preexisting label if it has already been registered on the server.
  • usesContext: Array of context needed by the source only in the editor. Will be merged with existingย uses_contextย if it has already been registered on the server.
  • getValues: Function to get the values from the source. It receives select, clientId, context, and the block bindings created for that specific source. It must return an object with attribute: value. Similar to getBlockAttributes.
  • setValues: Function to update multiple values connected to the source. It receives select, clientId, dispatch, context, and the block bindings created for that specific source, including the new value. Similar to updateBlockAttributes.
  • canUserEditValue: Function to let the editor know if the block attribute connected should be editable or not. It receives select, context, and the source arguments.
Example Usagesย 
Register a Block Bindings Source

Building on the example server registration, use the following JavaScriptJavaScript JavaScript 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 to register in the editor by enqueuing on the enqueue_block_editor_assets hook:

import { registerBlockBindingsSource } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';
import { store as coreEditorStore } from '@wordpress/editor';

const allowedAttributes = [ 'title', 'excerpt' ];

registerBlockBindingsSource( {
    name: 'my-plugin/post-attributes',
    usesContext: [ 'postType' ],	
    getValues( { select, bindings } ) {
        const values = {};
        for ( const [ attributeName, source ] of Object.entries( bindings ) ) {
            if ( allowedAttributes.includes( source.args.key ) ) {
                values[ attributeName ] = select( coreEditorStore ).getEditedPostAttribute( source.args.key );
            }
        }
        return values;
    },
    setValues( { dispatch, bindings } ) {
        const newValues = {};
        for ( const [ attributeName, source ] of Object.entries( bindings ) ) {
            if ( allowedAttributes.includes( source.args.key ) ) {
                newValues[ source.args.key ] = source.newValue;
            }
        }
        if ( Object.keys( newValues ).length > 0 ) {
            dispatch( coreEditorStore ).editPost( newValues );
        }
    },
    canUserEditValue( { context, args } ) {
        return allowedAttributes.includes( args.key ) && 'post' === context.postType;
    },
} );

To connect example blocks to the source, go to the post editor, open the code editor, and use the following markup:

<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"my-plugin/post-attributes","args":{"key":"title"}}}}} -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"my-plugin/post-attributes","args":{"key":"excerpt"}}}}} -->
<p></p>
<!-- /wp:paragraph -->

For a more in-depth example of how these properties can be defined in a real-world scenario, see the registration for the built-in post meta source.

Unregister a Block Bindings Source
import { unregisterBlockBindingsSource } from '@wordpress/blocks';

unregisterBlockBindingsSource( 'plugin/my-custom-source' );
Get All Block Bindings Sources
import { getBlockBindingsSources } from '@wordpress/blocks';

const registeredSources = getBlockBindingsSources();
Get a Block Bindings Source
import { getBlockBindingsSource } from '@wordpress/blocks';

const blockBindingsSource = getBlockBindingsSource( 'plugin/my-custom-source' );

Note: If desired, sources may be registered only on the client and not on the server at all. This could be useful for creating forms in the adminadmin (and super admin), or otherwise using bindings to interact with other parts of WordPress, or other dynamic data.

Block Bindings Utils

The useBlockBindingsUtils hook returns helper functions to modify the metadata.bindings attribute. The hook accepts an optional clientId argument. If the clientId is not specified, the helper functions will execute in the current block edit context.

Right now, the helpers include:

  • updateBlockBindings: This works similarly to updateBlockAttributes. It can be used to create, update, or remove specific connections.
  • removeAllBlockBindings: This is used to remove all existing connections in a block.

Example usage

import { useBlockBindingsUtils } from '@wordpress/block-editor';

const { updateBlockBindings, removeAllBlockBindings } = useBlockBindingsUtils();

// Updates bindings for url and alt attributes.
updateBlockBindings( {
ย ย ย ย url: {
ย ย ย ย ย ย ย ย source: 'core/post-meta',
ย ย ย ย ย ย ย ย args: {
ย ย ย ย ย ย ย ย ย ย ย ย key: 'url_custom_field',
ย ย ย ย ย ย ย ย },
ย ย ย ย },
ย ย ย ย alt: {
ย ย ย ย ย ย ย ย source: 'core/post-meta',
ย ย ย ย ย ย ย ย args: {
ย ย ย ย ย ย ย ย ย ย ย ย key: 'alt_custom_field',
ย ย ย ย ย ย ย ย },
ย ย ย ย },
} );

// Removes all bindings set for the block.
removeAllBlockBindings();

Used internally by the default UI for the post meta source and pattern overrides, these utils can be useful in building custom UI for other sources.

For more examples of how these functions are used in practice by the built-in UI, see the calls to updateBlockBindings and removeAllBlockBindings.

New Server Filter

A block_bindings_source_value filter has been introduced to allow for overriding of the value returned by a source in a bound block. It takes the following arguments:

  • value: Value returned by the source.
  • name: Name of the source.
  • source_args: Arguments passed to the source.
  • block_instance: The bound block.
  • attribute_name: The connected attribute in the bound block.
function modify_block_bindings_source_value( $value, $name, $source_args, $block_instance, $attribute_name ) {
    if ( 'core/post-meta' === $name && 'movie_runtime' === $source_args['key'] ) {
        return $value . ' minutes';
    }
    return $value;
}
add_filter( 'block_bindings_source_value', 'modify_block_bindings_source_value', 10, 5 );

Conclusion

The developers behind Block Bindings are always happy to hear feedback. Please feel free to share bugs, feature requests, or other thoughts by creating issues on GithubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the โ€˜pull requestโ€™ where code changes done in branches by contributors can be reviewed and discussed before being merged by the repository owner. https://github.com/ or leaving a comment on this post.

Anyone can also follow and comment on Block Bindings development via the latest iteration, which is posted in the Block Bindings tracking issue at the beginning of each release cycle. Be sure to subscribe to the tracking issue for updates!

Lastly, if youโ€™d like to help shape the roadmap for Block Bindings by sharing your use cases, feel free to post in Block Bindings discussions.

Props to @santosguillamot @gziolo @cbravobernal @greenshady @fabiankaegy and @welcher for their help compiling this post.

#6-7, #block-bindings, #dev-notes, #dev-notes-6-7