Commit 0396d18b930 for woocommerce
commit 0396d18b9306e9ba19e363a710136155122e90bd
Author: Raluca Stan <ralucastn@gmail.com>
Date: Thu Sep 17 16:04:38 2026 +0200
Fix the order confirmation hook docblock (#68152)
* Correct the order received title filter docblock
woocommerce_thankyou_order_received_title is Blocks-owned: core never
fires it, so this docblock is the only definition of its contract.
@since 9.6.0 is wrong. The hook is absent from the 9.6.0 tree: it came
in with b6229aa619 (#49317) after 9.6 branched, shipped in the 9.5.2
point release, and is continuously available from 9.7.0, so 9.7.0 is
the value a caller can rely on.
WC_Order unqualified does not resolve to the global class from this
namespace. Qualify it the way the rest of the file does.
$order can never be false here. AbstractOrderConfirmationBlock::render()
only calls render_content() when it has an order, and this method calls
$order->get_id() and $order->get_status() before the filter fires. The
|false the docblock promised was never reachable, so drop it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add changelog entry for the order confirmation hook docs
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Drop the baseline entry the order type qualification resolved
Writing the param as \WC_Order made PHPStan resolve it to the global
class, so the parameter.phpDocType error baselined for Status.php no
longer fires and the baseline check failed on the stale entry.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
diff --git a/plugins/woocommerce/changelog/67855-hook-docs-order-confirmation b/plugins/woocommerce/changelog/67855-hook-docs-order-confirmation
new file mode 100644
index 00000000000..3f45ee70799
--- /dev/null
+++ b/plugins/woocommerce/changelog/67855-hook-docs-order-confirmation
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Correct the woocommerce_thankyou_order_received_title docblock on the Order Confirmation Status block.
diff --git a/plugins/woocommerce/client/blocks/docs/third-party-developers/extensibility/hooks/filters.md b/plugins/woocommerce/client/blocks/docs/third-party-developers/extensibility/hooks/filters.md
index 986c567f31a..4959871bf86 100644
--- a/plugins/woocommerce/client/blocks/docs/third-party-developers/extensibility/hooks/filters.md
+++ b/plugins/woocommerce/client/blocks/docs/third-party-developers/extensibility/hooks/filters.md
@@ -1913,7 +1913,7 @@ Runs after the legacy order-received filter so callbacks can customize the final
Filter the title shown after a checkout is complete.
```php
-apply_filters( 'woocommerce_thankyou_order_received_title', string $title, \WC_Order|false $order )
+apply_filters( 'woocommerce_thankyou_order_received_title', string $title, \WC_Order $order )
```
### Parameters
@@ -1921,7 +1921,7 @@ apply_filters( 'woocommerce_thankyou_order_received_title', string $title, \WC_O
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $title | string | The title. |
-| $order | \WC_Order, false | The order created during checkout, or false if order data is not available. |
+| $order | \WC_Order | The order created during checkout. |
### Source
diff --git a/plugins/woocommerce/phpstan-baseline.neon b/plugins/woocommerce/phpstan-baseline.neon
index 5bce451c237..6fdc10cebca 100644
--- a/plugins/woocommerce/phpstan-baseline.neon
+++ b/plugins/woocommerce/phpstan-baseline.neon
@@ -50350,12 +50350,6 @@ parameters:
count: 1
path: src/Blocks/BlockTypes/OrderConfirmation/ShippingAddress.php
- -
- message: '#^@param Automattic\\WooCommerce\\Blocks\\BlockTypes\\OrderConfirmation\\WC_Order\|false \$order does not accept actual type of parameter\: WC_Order\.$#'
- identifier: parameter.phpDocType
- count: 1
- path: src/Blocks/BlockTypes/OrderConfirmation/Status.php
-
-
message: '#^Parameter \#1 \$date of function wc_format_datetime expects WC_DateTime, WC_DateTime\|null given\.$#'
identifier: argument.type
diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Status.php b/plugins/woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Status.php
index fbc90e02eb6..363c4390d29 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Status.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Status.php
@@ -78,10 +78,10 @@ class Status extends AbstractOrderConfirmationBlock {
/**
* Filter the title shown after a checkout is complete.
*
- * @since 9.6.0
+ * @since 9.7.0
*
- * @param string $title The title.
- * @param WC_Order|false $order The order created during checkout, or false if order data is not available.
+ * @param string $title The title.
+ * @param \WC_Order $order The order created during checkout.
*/
apply_filters(
'woocommerce_thankyou_order_received_title',