/**
* Add theme.json and full block support to classic themes.
*/
function add_full_block_support_to_classic_theme() {
$theme_json_path = get_template_directory() . '/theme.json';
if ( ! file_exists( $theme_json_path ) ) {
$theme_json_content = array(
'version' => 2,
'settings' => array(
'appearanceTools' => true,
'layout' => array(
'contentSize' => '800px',
'wideSize' => '1200px'
),
'color' => array(
'defaultPalette' => true,
'defaultGradients' => true,
'link' => true,
'custom' => true
),
'typography' => array(
'fluid' => true,
'dropCap' => true,
'fontSizes' => array(),
'fontFamilies' => array(),
'customFontSize' => true,
'lineHeight' => true,
'letterSpacing' => true,
'fontStyle' => true,
'fontWeight' => true,
'textDecoration' => true,
'textTransform' => true
),
'spacing' => array(
'padding' => true,
'margin' => true,
'blockGap' => true,
'units' => array( '%', 'px', 'em', 'rem', 'vh', 'vw' )
),
'border' => array(
'color' => true,
'radius' => true,
'style' => true,
'width' => true
),
'custom' => array(
'spacing' => true,
'typography' => true,
'border' => true
)
)
);
file_put_contents(
$theme_json_path,
wp_json_encode( $theme_json_content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES )
);
}
add_theme_support( 'wp-block-styles' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'appearance-tools' );
add_theme_support( 'editor-styles' );
remove_theme_support( 'block-templates' );
}
add_action( 'after_setup_theme', 'add_full_block_support_to_classic_theme' );