Editor chat summary: Wednesday, October 18, 2023

This post summarizes the weekly editor chat meeting on Wednesday, 18 October 2023, 14:00 UTC, held in Slack.

Agenda of the meeting at https://make.wordpress.org/core/2023/10/17/editor-chat-agenda-wednesday-18-october-2023/.

Announcements

Last week we had security and maintenance releases for both WordPress and 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/ 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: https://wordpress.org/news/2023/10/wordpress-6-3-2-maintenance-and-security-release/ and https://github.com/WordPress/gutenberg/releases/tag/v16.8.1. Please make sure they are both updated.
WordPress 6.4 RC1 was released on October 17 https://wordpress.org/news/2023/10/wordpress-6-4-release-candidate-1/.

Open floor

There were two questions raised by Andrei Glingeanu.

Question 1:

Is the possibility of adding custom tabs here prohibited intentionally?

Print screen of 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. inspector sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme. with a custom item added at the side of the page and block.

@jorgefilipecosta said:

 We never added extensibility api’s to create new tabs there. There was not an intentional decision to never do it, but there was also never a decision to do it. I guess the best bet for now is to create a custom sidebar.

Question 2:

Is there a standard way of outputting dynamic css for a custom block besides putting it inline in style="" attributes and without outputting <style> tags in the edit function of the block?

@jorgefilipecosta said:

In my personal opinion, it depends on the case:

  • If the dynamic CSSCSS Cascading Style Sheets. styles you want to add should affect just a single instance of the block I think using the style attribute may be the way to go.
  • If the dynamic CSS styles you want to add should affect all the instances of your custom block, I guess a good option is to use the global styles filters and 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. 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. to add the styles you want for the block dynamically.
  • If it is dynamic but there is a limited set of different possible styles e.g.: dynamic but there are like 5 different style configurations. Probably creating classes as part of the block styles CSS and then dynamically deciding which class to add to the block seems to be the way to go.

#core-editor, #core-editor-summary, #gutenberg, #meeting, #meeting-notes, #summary