Commit beb71568ba for woocommerce
commit beb71568bac30421d785e0df91b05e3a5648023d
Author: Povilas Staskus <povilas.staskus@automattic.com>
Date: Wed Feb 25 08:28:18 2026 +0200
Fix _load_textdomain_just_in_time warning from PointOfSaleEmailHandler (#63441)
Remove early FeaturesUtil call from PointOfSaleEmailHandler to fix textdomain warning
Fixes #63433. Bug introduced in PR #63322.
diff --git a/plugins/woocommerce/src/Internal/Orders/PointOfSaleEmailHandler.php b/plugins/woocommerce/src/Internal/Orders/PointOfSaleEmailHandler.php
index 07d1f59de2..d2aaf8a377 100644
--- a/plugins/woocommerce/src/Internal/Orders/PointOfSaleEmailHandler.php
+++ b/plugins/woocommerce/src/Internal/Orders/PointOfSaleEmailHandler.php
@@ -8,7 +8,6 @@ declare( strict_types = 1 );
namespace Automattic\WooCommerce\Internal\Orders;
use Automattic\WooCommerce\Internal\RegisterHooksInterface;
-use Automattic\WooCommerce\Utilities\FeaturesUtil;
use WC_Abstract_Order;
/**
@@ -41,10 +40,6 @@ class PointOfSaleEmailHandler implements RegisterHooksInterface {
* Register hooks and filters.
*/
public function register(): void {
- if ( ! FeaturesUtil::feature_is_enabled( 'point_of_sale' ) ) {
- return;
- }
-
foreach ( self::SUPPRESSED_EMAIL_IDS as $email_id ) {
add_filter( 'woocommerce_email_enabled_' . $email_id, array( $this, 'maybe_suppress_email' ), 10, 2 );
}
diff --git a/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleEmailHandlerTest.php b/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleEmailHandlerTest.php
index 2900e73cd6..cd2b88b1a2 100644
--- a/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleEmailHandlerTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/Orders/PointOfSaleEmailHandlerTest.php
@@ -101,11 +101,9 @@ class PointOfSaleEmailHandlerTest extends WC_Unit_Test_Case {
}
/**
- * @testdox register adds filters only when POS feature is enabled.
+ * @testdox register adds email suppression filters for all standard email IDs.
*/
- public function test_register_adds_filters_when_pos_enabled(): void {
- update_option( 'woocommerce_feature_point_of_sale_enabled', 'yes' );
-
+ public function test_register_adds_filters(): void {
$handler = new PointOfSaleEmailHandler();
$handler->register();
@@ -135,21 +133,4 @@ class PointOfSaleEmailHandlerTest extends WC_Unit_Test_Case {
remove_all_filters( 'woocommerce_email_enabled_customer_partially_refunded_order' );
remove_all_filters( 'woocommerce_email_enabled_new_order' );
}
-
- /**
- * @testdox register does not add filters when POS feature is disabled.
- */
- public function test_register_does_not_add_filters_when_pos_disabled(): void {
- remove_all_filters( 'woocommerce_email_enabled_customer_completed_order' );
- update_option( 'woocommerce_feature_point_of_sale_enabled', 'no' );
-
- $handler = new PointOfSaleEmailHandler();
- $handler->register();
-
- $this->assertFalse(
- has_filter( 'woocommerce_email_enabled_customer_completed_order', array( $handler, 'maybe_suppress_email' ) )
- );
-
- delete_option( 'woocommerce_feature_point_of_sale_enabled' );
- }
}