BC issue with woocommerce_thankyou_order_received_text #40329
Labels
focus: template
Issue related to WooCommerce templates.
team: Proton
type: regression
Issues that have been introduced by the code change that impacted existing functionality.
Prerequisites
Describe the bug
In #39758 we introduced a new template for the order-received note: https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/templates/checkout/order-received.php
The new template escapes now the output of the
woocommerce_thankyou_order_received_text
filter, which was not escaped before: https://github.com/woocommerce/woocommerce/pull/39758/files#diff-564a2935633e7fbf95ba8f1cae13c198399275de26dfb1c994868b6e9a3437c1L42This introduces a bc problems for integrations using this filter and returning HTML.
Expected behavior
The output should not be escaped. This would follow also how we treat other filters in the templates, for example here:
woocommerce/plugins/woocommerce/templates/myaccount/my-orders.php
Line 37 in 7f9322c
or in this template https://github.com/woocommerce/woocommerce/blob/7f9322c85858a17f6e9e9e79eaa3aefeda1a0624/plugins/woocommerce/templates/myaccount/my-downloads.php
Actual behavior
The output gets escaped by using
esc_html()
, which converts HTML tags into text.Steps to reproduce
Thank you!
'; });<p><strong>Thank you!</strong></p>
WordPress Environment
WC Version: 8.1.0
Isolating the problem
The text was updated successfully, but these errors were encountered: