-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Enable appearance tools via theme_support #43337
Conversation
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.
This is ace, thank you for working on it! It tests well for me ✨
There is a list of theme features in this theme.ts file, I'm not sure if we need to add appearance tools there as well?
Good call, yea. |
Fix spelling and punctuation. Co-authored-by: Jeff Ong <[email protected]>
@pbking Did you already open a trac issue for adding the theme support to the bundled themes? |
Once this change landed in the plugin we implemented it in all of the Varia themes. In part to provide more options for users of those themes and in part to evaluate the feature. We found that, mostly due to the fact that this enables I'm hesitant recommending that we enable this feature on core bundled themes; at least not without careful evaluation of each when it's enabled. A better scenario would be more fine-grained control of the features... but that seems more like adding a theme.json file would be the tool for that job (which also causes layout changes to a theme which is why the theme_support option was explored). |
Allowing themes to enable the theme support is separate from adding it to the default themes. The theme support would still have been a big help for new classic themes where the spacing would not be an unexpected change. |
@pbking Will this be a part of the backport for 6.1? I'm currently testing this in WordPress 6.1 beta1, but it does not work unless I enable the Gutenberg plugin. |
I do not know why it was not included but we are past the feature freeze for 6.1 |
@ockham can we consider this for backport please? :) |
I've filed one now: WordPress/wordpress-develop#3337 Note that since this affects PHP code in This might not be the easiest to get into 6.1, since Core is only accepting bugfixes at this point. If you'd like to see this accepted into Core, y'all might wanna campaign for it over at WordPress/wordpress-develop#3337 😅 |
Removing the "Backport to WP Beta/RC" label; nothing left to do with this PR, the backport is entirely covered by WordPress/wordpress-develop#3337. |
Punted to 6.2 |
|
Port changes to the base class that were meant to be part of 6.1. See #43337
… inheriting per WordPress version (#46750) * Backport WP_Theme_JSON_Resolver from core as it is * Substitute WP_Theme_JSON by WP_Theme_JSON_Gutenberg * Substitute WP_Theme_JSON_Data by WP_Theme_JSON_Data_Gutenberg * Rename WP_Theme_JSON_Resolver to WP_Theme_JSON_Resolver_Base The goal is to use it as base to inherit from, until we are able to remove all the children. * Make WP_Theme_JSON_Resolver_6_1 inherit from WP_Theme_JSON_Resolver_Base * 6.1: remove field already defined in base class * 6.1: remove translate, it is equal to base method * 6.1: remove get_core_data, it does not have base changes * 6.1: remove get_user_data Missed core changes and does not do anything differently from core. * 6.1: remove get_user_data_from_wp_global_styles It misses core changes and does not do anything differently. * 6.2: inherit from WP_Theme_JSON_Resolver_Base instead of 6.1 This makes the WP_Theme_JSON_Resover_6_1 class unused. * 6.1: remove class no longer in use * 6.2: deprecate theme_has_support #45380 * 6.2: substitute WP_Theme_JSON_Resolver::theme_has_support by wp_theme_has_theme_json() #45168 * 6.2: port changes to get_user_data_from_wp_global_styles #46043 * 6.2: update get_merged_data #45969 * 6.2: remove get_user_data Same code as core. There's a check for detecting whether the class is an instance of WP_Theme_JSON_Gutenberg that was not ported. This check was introduced to make sure the cache of the core class didn't interfere with the cache of the Gutenberg class, so it's no longer necessary. See #42756 * experimental: make it inherit from WP_Theme_JSON_Resolver_Base * 6.2: remove class no longer in use * experimental: delete remove_json_comments It's already part of the base class. * experimental: remove get_block_data It's already part of the base class and it didn't have the changes from core. * experimental: appearanceTools Port changes to the base class that were meant to be part of 6.1. See #43337 * experimental: port webfonts (experimental API) see #37140 * experimental: use gutenberg_get_legacy_theme_supports_for_theme_json #46112 * experimental: get_theme_data, all code is in the base class * experimental: remove empty class * Rename WP_Theme_JSON_Resolver_Base to WP_Theme_JSON_Resolver_Gutenberg * Fix lint issue: rename class-wp-theme-json-resolver.php to class-wp-theme-json-resolver-gutenberg.php * Move theme.json to unversioned lib/ * Move theme-i18n.json to unversioned lib/
… inheriting per WordPress version (#46750) * Backport WP_Theme_JSON_Resolver from core as it is * Substitute WP_Theme_JSON by WP_Theme_JSON_Gutenberg * Substitute WP_Theme_JSON_Data by WP_Theme_JSON_Data_Gutenberg * Rename WP_Theme_JSON_Resolver to WP_Theme_JSON_Resolver_Base The goal is to use it as base to inherit from, until we are able to remove all the children. * Make WP_Theme_JSON_Resolver_6_1 inherit from WP_Theme_JSON_Resolver_Base * 6.1: remove field already defined in base class * 6.1: remove translate, it is equal to base method * 6.1: remove get_core_data, it does not have base changes * 6.1: remove get_user_data Missed core changes and does not do anything differently from core. * 6.1: remove get_user_data_from_wp_global_styles It misses core changes and does not do anything differently. * 6.2: inherit from WP_Theme_JSON_Resolver_Base instead of 6.1 This makes the WP_Theme_JSON_Resover_6_1 class unused. * 6.1: remove class no longer in use * 6.2: deprecate theme_has_support #45380 * 6.2: substitute WP_Theme_JSON_Resolver::theme_has_support by wp_theme_has_theme_json() #45168 * 6.2: port changes to get_user_data_from_wp_global_styles #46043 * 6.2: update get_merged_data #45969 * 6.2: remove get_user_data Same code as core. There's a check for detecting whether the class is an instance of WP_Theme_JSON_Gutenberg that was not ported. This check was introduced to make sure the cache of the core class didn't interfere with the cache of the Gutenberg class, so it's no longer necessary. See #42756 * experimental: make it inherit from WP_Theme_JSON_Resolver_Base * 6.2: remove class no longer in use * experimental: delete remove_json_comments It's already part of the base class. * experimental: remove get_block_data It's already part of the base class and it didn't have the changes from core. * experimental: appearanceTools Port changes to the base class that were meant to be part of 6.1. See #43337 * experimental: port webfonts (experimental API) see #37140 * experimental: use gutenberg_get_legacy_theme_supports_for_theme_json #46112 * experimental: get_theme_data, all code is in the base class * experimental: remove empty class * Rename WP_Theme_JSON_Resolver_Base to WP_Theme_JSON_Resolver_Gutenberg * Fix lint issue: rename class-wp-theme-json-resolver.php to class-wp-theme-json-resolver-gutenberg.php * Move theme.json to unversioned lib/ * Move theme-i18n.json to unversioned lib/
This changeset merges the following changes from Gutenberg repository: - Allow themes without `theme.json` to opt-in to appearance tools via `add_theme_support( 'appearance-tools' );` - Update `wpThemeJsonResolver` unit tests accordingly See the following pull request for more info: WordPress/gutenberg#43337 Props ironprogrammer, audrasjb. Fixes #57460. Built from https://develop.svn.wordpress.org/trunk@55067 git-svn-id: http://core.svn.wordpress.org/trunk@54600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset merges the following changes from Gutenberg repository: - Allow themes without `theme.json` to opt-in to appearance tools via `add_theme_support( 'appearance-tools' );` - Update `wpThemeJsonResolver` unit tests accordingly See the following pull request for more info: WordPress/gutenberg#43337 Props ironprogrammer, audrasjb. Fixes #57460. Built from https://develop.svn.wordpress.org/trunk@55067 git-svn-id: https://core.svn.wordpress.org/trunk@54600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
I have removed the needs dev note label because this feature is not in 6.2: |
I've noticed this feature was backported to 6.2 as of https://core.trac.wordpress.org/ticket/56487 and had to be reverted as of https://core.trac.wordpress.org/ticket/57649 In #48622 I'm marking this code not to backport until the issues are resolved. |
This changeset merges the following changes from Gutenberg repository: - Allow themes without `theme.json` to opt-in to appearance tools via `add_theme_support( 'appearance-tools' );` - Update `wpThemeJsonResolver` unit tests accordingly See the following pull request for more info: WordPress/gutenberg#43337 Props ironprogrammer, audrasjb. Fixes #57460. Built from https://develop.svn.wordpress.org/trunk@55067 git-svn-id: http://core.svn.wordpress.org/trunk@54600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Allow a theme to enable
appearanceTools
to any theme including classic themes.Why?
Appearance tools are options in the block editor and don't require the use of the FSE to take advantage of. However there's no way to enable those tools for themes that don't use theme.json.
How?
This checks for the 'appearance-tools' support and if present flags
settings.appearanceTools
as true in thetheme
portion of Global Styles.Testing Instructions
Using a theme that does NOT use a theme.json file enable the 'appearanceTools` theme support.
Add a group block to a new post. Note the block settings panel includes
Border
settings.