Skip to content

Commit

Permalink
Fix theme requirement validation with WP 5.8 (#37226)
Browse files Browse the repository at this point in the history
* Fix theme requirement validation with WP 5.8

* Use compat file

* Update comment
  • Loading branch information
Mamaduka authored Dec 8, 2021
1 parent 64c1ddb commit 8aa8230
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/compat/wordpress-5.9/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 8aa8230

Please sign in to comment.