wp_is_block_theme()
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
#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() wp is block theme code WP 6.7.2
function wp_is_block_theme() { return wp_get_theme()->is_block_theme(); }