wp_is_block_theme()WP 5.9.0

Returns whether the current theme is a block-based theme or not.

No Hooks.

Return

true|false. Whether the active theme is a block-based theme or not.

Usage

wp_is_block_theme();

Examples

0

#1 Check if it's block theme or not

if( wp_is_block_theme() ){
	echo 'The current theme is blocky.';
} 
else {
	echo 'The current theme is not a block theme';
}

Changelog

Since 5.9.0 Introduced.

wp_is_block_theme() code WP 6.5.2

function wp_is_block_theme() {
	return wp_get_theme()->is_block_theme();
}