'default-repeat' => array(
'default-attachment' => array(
'default-color' => array(
'description' => __( 'Custom header if defined by the theme.' ),
'default-image' => array(
'random-default' => array(
'default-text-color' => array(
'description' => __( 'Custom logo if defined by the theme.' ),
'unlink-homepage-logo' => array(
'customize-selective-refresh-widgets',
'description' => __( 'Whether the theme enables Selective Refresh for Widgets being managed with the Customizer.' ),
'description' => __( 'Whether theme opts in to the dark editor style UI.' ),
'description' => __( 'Whether the theme disables custom colors.' ),
'disable-custom-font-sizes',
'description' => __( 'Whether the theme disables custom font sizes.' ),
'disable-custom-gradients',
'description' => __( 'Whether the theme disables custom gradients.' ),
'description' => __( 'Whether the theme disables generated layout styles.' ),
'description' => __( 'Custom color palette if defined by the theme.' ),
'description' => __( 'Custom font sizes if defined by the theme.' ),
'editor-gradient-presets',
'description' => __( 'Custom gradient presets if defined by the theme.' ),
'description' => __( 'Custom spacing sizes if defined by the theme.' ),
'description' => __( 'Whether theme opts in to the editor styles CSS wrapper.' ),
'description' => __( 'Allows use of HTML5 markup for search forms, comment forms, comment lists, gallery, and caption.' ),
'description' => __( 'Post formats supported.' ),
'enum' => get_post_format_slugs(),
'default' => array( 'standard' ),
'prepare_callback' => static function ( $formats ) {
$formats = is_array( $formats ) ? array_values( $formats[0] ) : array();
$formats = array_merge( array( 'standard' ), $formats );
'description' => __( 'The post types that support thumbnails or true if all post types are supported.' ),
'type' => array( 'boolean', 'array' ),
'description' => __( 'Whether the theme supports responsive embedded content.' ),
'description' => __( 'Whether the theme can manage the document title tag.' ),
'description' => __( 'Whether theme opts in to default WordPress block styles for viewing.' ),
* Returns whether the active theme is a block-based theme or not.
* @return bool Whether the active theme is a block-based theme or not.
function wp_is_block_theme() {
if ( empty( $GLOBALS['wp_theme_directories'] ) ) {
_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before the theme directory is registered.' ), '6.8.0' );
return wp_get_theme()->is_block_theme();
* Given an element name, returns a class name.
* Alias of WP_Theme_JSON::get_element_class_name.
* @param string $element The name of the element.
* @return string The name of the class.
function wp_theme_get_element_class_name( $element ) {
return WP_Theme_JSON::get_element_class_name( $element );
* Adds default theme supports for block themes when the 'after_setup_theme' action fires.
* See {@see 'after_setup_theme'}.
function _add_default_theme_supports() {
if ( ! wp_is_block_theme() ) {
add_theme_support( 'post-thumbnails' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'editor-styles' );
* Makes block themes support HTML5 by default for the comment block and search form
* (which use default template functions) and `[caption]` and `[gallery]` shortcodes.
* Other blocks contain their own HTML5 markup.
add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'search-form', 'gallery', 'caption', 'style', 'script' ) );
add_theme_support( 'automatic-feed-links' );
add_filter( 'should_load_separate_core_block_assets', '__return_true' );
add_filter( 'should_load_block_assets_on_demand', '__return_true' );
* Remove the Customizer's Menus panel when block theme is active.
'customize_panel_active',
static function ( $active, WP_Customize_Panel $panel ) {
'nav_menus' === $panel->id &&
! current_theme_supports( 'menus' ) &&
! current_theme_supports( 'widgets' )