Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions projects/packages/blocks/changelog/fix-related-posts-fse
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Update method checking for block-based themes to use latest core function.
3 changes: 2 additions & 1 deletion projects/packages/blocks/src/class-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ public static function is_amp_request() {
* @return bool True if the current theme is an FSE/Site Editor theme.
*/
public static function is_fse_theme() {
$is_fse_theme = function_exists( 'gutenberg_is_fse_theme' ) && gutenberg_is_fse_theme();
$is_fse_theme = wp_is_block_theme()
|| ( function_exists( 'gutenberg_is_fse_theme' ) && gutenberg_is_fse_theme() );

/**
* Returns true if the current theme is an FSE/Site Editor theme.
Expand Down
10 changes: 5 additions & 5 deletions projects/packages/blocks/tests/php/test-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function test_jetpack_register_block_without_jetpack() {
*
* @since 9.8.0
*
* @covers Automattic\Jetpack\Blocks::is_standalone_block
* @covers Automattic\Jetpack\Blocks::is_fse_theme
*/
public function test_is_not_fse_theme() {
$this->assertFalse( Blocks::is_fse_theme() );
Expand All @@ -236,7 +236,7 @@ public function test_is_not_fse_theme() {
*
* @since 9.8.0
*
* @covers Automattic\Jetpack\Blocks::is_standalone_block
* @covers Automattic\Jetpack\Blocks::is_fse_theme
*/
public function test_is_fse_theme_via_filter() {
add_filter( 'jetpack_is_fse_theme', '__return_true' );
Expand All @@ -248,13 +248,13 @@ public function test_is_fse_theme_via_filter() {
}

/**
* Test that we can detect an FSE theme using the provided core function, gutenberg_is_fse_theme.
* Test that we can detect an FSE theme using the provided gutenberg_is_fse_theme function.
*
* @since 9.8.0
*
* @covers Automattic\Jetpack\Blocks::is_standalone_block
* @covers Automattic\Jetpack\Blocks::is_fse_theme
*/
public function test_is_fse_theme_via_core_function() {
public function test_is_fse_theme_via_gutenberg_function() {
Functions\when( 'gutenberg_is_fse_theme' )->justReturn( true );

$this->assertTrue( Blocks::is_fse_theme() );
Expand Down