diff --git a/changelog/add-3943-send-blog-theme-to-sift b/changelog/add-3943-send-blog-theme-to-sift new file mode 100644 index 00000000000..7f67989d63f --- /dev/null +++ b/changelog/add-3943-send-blog-theme-to-sift @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add the active theme name of the blog to the compatibility service diff --git a/includes/class-compatibility-service.php b/includes/class-compatibility-service.php index 444b3383cb1..c2744e8fa28 100644 --- a/includes/class-compatibility-service.php +++ b/includes/class-compatibility-service.php @@ -52,6 +52,7 @@ public function update_compatibility_data() { [ 'woopayments_version' => WCPAY_VERSION_NUMBER, 'woocommerce_version' => WC_VERSION, + 'blog_theme' => get_stylesheet(), ] ); } catch ( API_Exception $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch diff --git a/tests/unit/test-class-compatibility-service.php b/tests/unit/test-class-compatibility-service.php index 70e86b5d2dc..99a279233c1 100644 --- a/tests/unit/test-class-compatibility-service.php +++ b/tests/unit/test-class-compatibility-service.php @@ -43,10 +43,19 @@ public function test_registers_woocommerce_filters_properly() { } public function test_update_compatibility_data() { + $stylesheet = 'my_theme_name'; + add_filter( + 'stylesheet', + function( $theme ) use ( $stylesheet ) { + return $stylesheet; + } + ); + // Arrange: Create the expected value to be passed to update_compatibility_data. $expected = [ 'woopayments_version' => WCPAY_VERSION_NUMBER, 'woocommerce_version' => WC_VERSION, + 'blog_theme' => $stylesheet, ]; // Arrange/Assert: Set the expectations for update_compatibility_data.