From 8aa82304adbc905564e37ff75795a78a3ff6b4a4 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 8 Dec 2021 18:03:37 +0000 Subject: [PATCH] Fix theme requirement validation with WP 5.8 (#37226) * Fix theme requirement validation with WP 5.8 * Use compat file * Update comment --- lib/compat/wordpress-5.9/theme.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/compat/wordpress-5.9/theme.php b/lib/compat/wordpress-5.9/theme.php index 43862e6bf6117a..7bfe11f604c5b6 100644 --- a/lib/compat/wordpress-5.9/theme.php +++ b/lib/compat/wordpress-5.9/theme.php @@ -16,3 +16,13 @@ function wp_is_block_theme() { 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(); +}