Skip to content

Commit ad3bc23

Browse files
committed
Add theme name to compatibility service
1 parent 60f7e86 commit ad3bc23

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: add
3+
4+
Add the active theme name of the blog to the compatibility service

includes/class-compatibility-service.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function update_compatibility_data() {
5252
[
5353
'woopayments_version' => WCPAY_VERSION_NUMBER,
5454
'woocommerce_version' => WC_VERSION,
55+
'blog_theme' => get_stylesheet(),
5556
]
5657
);
5758
} catch ( API_Exception $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch

tests/unit/test-class-compatibility-service.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,19 @@ public function test_registers_woocommerce_filters_properly() {
4343
}
4444

4545
public function test_update_compatibility_data() {
46+
$stylesheet = 'my_theme_name';
47+
add_filter(
48+
'stylesheet',
49+
function( $theme ) use ( $stylesheet ) {
50+
return $stylesheet;
51+
}
52+
);
53+
4654
// Arrange: Create the expected value to be passed to update_compatibility_data.
4755
$expected = [
4856
'woopayments_version' => WCPAY_VERSION_NUMBER,
4957
'woocommerce_version' => WC_VERSION,
58+
'blog_theme' => $stylesheet,
5059
];
5160

5261
// Arrange/Assert: Set the expectations for update_compatibility_data.

0 commit comments

Comments
 (0)