diff --git a/src/Theme.php b/src/Theme.php index 0e62f39f..bb61a040 100644 --- a/src/Theme.php +++ b/src/Theme.php @@ -99,7 +99,6 @@ private function registerDefaultBindings(): void $this->instance('media', new Media()); $this->instance('parts', new Parts()); $this->instance('templates', new Templates()); - $this->instance('theme-json', new ThemeJson()); $this->instance('variations', new Variations()); } diff --git a/src/ThemeJson.php b/src/ThemeJson.php deleted file mode 100644 index e10dc452..00000000 --- a/src/ThemeJson.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @copyright Copyright (c) 2023-2024, Justin Tadlock - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL-3.0-or-later - * @link https://github.com/x3p0-dev/x3p0-ideas - */ - -declare(strict_types=1); - -namespace X3P0\Ideas; - -use WP_Theme_JSON_Data; -use X3P0\Ideas\Contracts\Bootable; -use X3P0\Ideas\Tools\HookAnnotation; - -class ThemeJson implements Bootable -{ - use HookAnnotation; - - /** - * Boots the component, running its actions/filters. - * - * @since 1.0.0 - */ - #[\Override] - public function boot(): void - { - $this->hookMethods(); - } - - /** - * Removes the core font-sizes entirely from the being rendered. We're - * handling the fallbacks for this via CSS. - * - * These were merged (and put at the top) of the font-size picker in - * Gutenberg 16.9 with no `theme.json`-method of disabling them. In the - * past, if a theme defined a set of custom sizes, these were not shown. - * @link https://github.com/WordPress/gutenberg/issues/55744 - * - * Gutenberg 17.6 added the `defaultFontSizes` prop: - * @link https://github.com/WordPress/gutenberg/pull/56661 - * - * @todo Remove above notes with WordPress 6.5+ min. requirement. - * - * @hook wp_theme_json_data_default - * @param WP_Theme_JSON_Data The Gutenberg plugin breaks this. - * @since 1.0.0 - */ - public function filterDefaultData(object $theme_json): object - { - $data = [ - 'version' => 2, - 'settings' => [ - 'typography' => [ - 'fontSizes' => [] - ] - ] - ]; - - return $theme_json->update_with($data); - } -} diff --git a/theme.json b/theme.json index 050aa5c0..323b83ab 100644 --- a/theme.json +++ b/theme.json @@ -869,6 +869,7 @@ }, "typography": { "customFontSize": false, + "defaultFontSizes": false, "dropCap": true, "fluid": false, "fontFamilies": [