add_theme_support() disabled for some editor options on without theme.json or experimental-link-color
support
#34931
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
Introduced in #34334.
After the above change was merged (specific commit), themes that do not have a theme.json file or declare support for
experimental-link-color
will fail to load some plugin-basedadd_theme_support()
calls. Calls from within the theme'sfunctions.php
file will still work as expected.This applies specifically to
custom-line-height
, but may also be true for other options.Step-by-step reproduction instructions
experimental-link-color
. I recommend Twenty Twenty for this test.Line height
option is not provided in the editor sidebar... this is expected, as the option is disabled by default..php
file:(note the priority of
11
. It ensures your plugin is firing after the theme's declarations, which will be important in a minute...)Line height
option is still not provided.Confirm your plugin is working:
wide width
andfull width
are included under alignment. This is expected, as support for these options is declared by the theme.remove_theme_support( 'align-wide' );
add_action
set to11
as shown abovewide
orfull width
alignments to image blocks.You now have a plugin that can modify some
theme_support
parameters likealign-wide
but fails to modify specific ones likecustom-line-height
. Note this is theme specific, as described above, and only applies to themes that lack atheme.json
file and do not declare support forexperimental-link-color
.Expected outcome
Different options should be respected equally. In the above example,
line height
would activate alongside the removal ofalign-wide
on TwentyTwenty.Screenshots, screen recording, code snippet
No response
Environment info
WP 5.8.1, Gutenberg 11.5.0, with Twenty Twenty active.
2019 MacBook Pro, MacOS 11.5.2, Chrome 93.0.4577.63
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: