Created
December 20, 2023 18:19
-
-
Save landbryo/053cd0006f89257f9cbfc6cfde062ba8 to your computer and use it in GitHub Desktop.
Enable the dropcap feature by modifying the theme.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add drop cap support to the theme.json file. | |
* | |
* @param array $theme_json The theme.json json. | |
* | |
* @link https://developer.wordpress.org/block-editor/developers/themes/theme-json/#typography | |
*/ | |
add_filter( 'wp_theme_json_data_theme', function( $theme_json ) { | |
$json = $theme_json->get_data(); | |
$json['settings']['typography'] = [ 'dropCap' => true ]; | |
return $theme_json->update_with( $json ); | |
}, 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment