diff --git a/composer.lock b/composer.lock index f5c6fbac..841b9867 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "codeinwp/themeisle-sdk", - "version": "3.3.65", + "version": "3.3.68", "source": { "type": "git", "url": "https://github.com/Codeinwp/themeisle-sdk.git", - "reference": "f650fe856d52ce4e5754557d89ba2f3127ad54d8" + "reference": "8477d5100ffdddd316a3e51129d775d8854d8a77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/f650fe856d52ce4e5754557d89ba2f3127ad54d8", - "reference": "f650fe856d52ce4e5754557d89ba2f3127ad54d8", + "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/8477d5100ffdddd316a3e51129d775d8854d8a77", + "reference": "8477d5100ffdddd316a3e51129d775d8854d8a77", "shasum": "" }, "require-dev": { @@ -43,9 +43,9 @@ ], "support": { "issues": "https://github.com/Codeinwp/themeisle-sdk/issues", - "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.65" + "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.68" }, - "time": "2026-09-29T09:35:47+00:00" + "time": "2026-10-27T13:38:50+00:00" } ], "packages-dev": [ diff --git a/library/archive/archive-boxed.php b/library/archive/archive-boxed.php index 85b0ae22..0fdab50c 100644 --- a/library/archive/archive-boxed.php +++ b/library/archive/archive-boxed.php @@ -16,7 +16,7 @@ -
+
diff --git a/library/archive/archive-cards.php b/library/archive/archive-cards.php index e8b95943..23574dcf 100644 --- a/library/archive/archive-cards.php +++ b/library/archive/archive-cards.php @@ -18,7 +18,7 @@ -
+
diff --git a/library/archive/archive-rows.php b/library/archive/archive-rows.php index d04a5faf..7dc664e4 100644 --- a/library/archive/archive-rows.php +++ b/library/archive/archive-rows.php @@ -16,7 +16,7 @@ -
+
diff --git a/tests/test-onboarding-templates.php b/tests/test-onboarding-templates.php new file mode 100644 index 00000000..5df8163e --- /dev/null +++ b/tests/test-onboarding-templates.php @@ -0,0 +1,55 @@ +, innerBlocks: list>, innerHTML: string, innerContent: list} + */ + +class Test_Onboarding_Templates extends WP_UnitTestCase { + /** + * Onboarding archive templates must list the posts of the archive being viewed. + * + * @return void + */ + public function test_archive_templates_inherit_the_archive_query(): void { + $support = get_theme_support( 'otter-onboarding' ); + + /** @var array $archive_templates */ + $archive_templates = $support[0]['templates']['archive']; + + $this->assertNotEmpty( $archive_templates ); + + foreach ( $archive_templates as $slug => $template ) { + $queries = $this->find_query_blocks( parse_blocks( include $template['file'] ) ); + + $this->assertNotEmpty( $queries, $slug ); + + foreach ( $queries as $query ) { + $this->assertTrue( $query['attrs']['query']['inherit'], $slug ); + } + } + } + + /** + * Collect every Query block, including nested ones. + * + * @param list $blocks Parsed blocks. + * + * @return list + */ + private function find_query_blocks( array $blocks ): array { + $queries = array(); + + foreach ( $blocks as $block ) { + if ( 'core/query' === $block['blockName'] ) { + $queries[] = $block; + } + + $queries = array_merge( $queries, $this->find_query_blocks( $block['innerBlocks'] ) ); + } + + return $queries; + } +}