-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix default theme supports #2029
Conversation
By default, block themes should have a few theme supports enabled by default. These are: post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links. This is a backport of WordPress/gutenberg#35593.
I tried adding a unit test for this but couldn't quite figure it out. Perhaps it's not possible because |
src/wp-includes/theme.php
Outdated
add_theme_support( 'post-thumbnails' ); | ||
add_theme_support( 'responsive-embeds' ); | ||
add_theme_support( 'editor-styles' ); | ||
add_theme_support( 'html5', array( 'style', 'script' ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to extend the HTML5 support for other elements too. At least for components which are used by blocks like comment-form
/comment-list
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think @youknowriad? I'm just copying over what's already in the plugin 😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also just copied what the themers suggested from 2022 theme. that said IMO, everything should be supported. Can we do *
or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that said IMO, everything should be supported. Can we do * or something like that?
No, add_theme_support( 'html5', ... )
intentionally requires an array of specific types to check, see this comment for context, and some more history in the description of https://core.trac.wordpress.org/ticket/51657.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the reasoning there though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should we do in the short term for 5.9?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can land this as is or by adding as much elements as available to at least be on the same page as the Gutenberg plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in #2029 (comment), we only have to add the two for the comments blocks.
add_theme_support( 'html5', array( 'style', 'script' ) ); | |
add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'style', 'script' ) ); |
search-form
, gallery
, caption
, and navigation-widgets
(not 100% sure) seem to be irrelevant for block themes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, declaring the support of navigation-widgets
currently doesn't change anything to the markup of the navigation widgets (page/category list, etc).
It's supposed to add a <nav>
container to the widget. This should probably be reported upstream since it's a regression from Classic themes. I'll open an issue on Gutenberg for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocean90 can you add those 2 https://github.com/WordPress/wordpress-develop/pull/2029/files#r766453524 upstream in Gutenberg please? Will go ahead with the suggestion here. But needs to be synched with Gutenberg too.
Co-authored-by: Dominik Schilling <dominikschilling+git@gmail.com>
By default, block themes should have a few theme supports enabled by default. These are: post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links.
This is a backport of WordPress/gutenberg#35593.
Trac ticket: https://core.trac.wordpress.org/ticket/54597
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.