# gutenberg/12.6.0/lib/compat/wordpress-5.9/theme.php

Gutenberg, version 12.6.0. 29 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/12.6.0/code/lib/compat/wordpress-5.9/theme.php
- Raw: https://pluginprobe.com/plugins/gutenberg/12.6.0/raw/lib/compat/wordpress-5.9/theme.php
- Modified: 2021-12-22T13:46:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenberg/12.6.0/code/lib/compat/wordpress-5.9/theme.php#L10-L20`.

```php
<?php
/**
 * Additions to the WordPress theme.php file
 *
 * @package gutenberg
 */

if ( ! function_exists( 'wp_is_block_theme' ) ) {
	/**
	 * Returns whether the current theme is a block theme or not.
	 *
	 * @return boolean Whether the current theme is a block theme or not.
	 */
	function wp_is_block_theme() {
		return is_readable( get_theme_file_path( '/block-templates/index.html' ) ) ||
			is_readable( get_theme_file_path( '/templates/index.html' ) );
	}
}

/**
 * Note: We have to maintain this function for backward compatibility with WP 5.8.
 * The `validate_theme_requirements` method is using `gutenberg_is_fse_theme` in older versions of WP.
 *
 * @return boolean Whether the current theme is a block theme or not.
 */
function gutenberg_is_fse_theme() {
	return wp_is_block_theme();
}

```
