Properly deprecate woocommerce_my_account_my_orders_columns filter (#36356)

* Use WC_Deprecated_Filter_Hooks to deprecate filter

* Add changelog file

* fix since tag in comment

* Revert docblock changes
This commit is contained in:
IanDelMar 2023-01-31 22:02:42 +01:00 committed by GitHub
parent ab0378634a
commit eeebcb9a6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Add missing deprecation notice for filter hook woocommerce_my_account_my_orders_columns.

View File

@ -21,6 +21,7 @@ class WC_Deprecated_Filter_Hooks extends WC_Deprecated_Hooks {
* @var array
*/
protected $deprecated_hooks = array(
'woocommerce_account_orders_columns' => 'woocommerce_my_account_my_orders_columns',
'woocommerce_structured_data_order' => 'woocommerce_email_order_schema_markup',
'woocommerce_add_to_cart_fragments' => 'add_to_cart_fragments',
'woocommerce_add_to_cart_redirect' => 'add_to_cart_redirect',
@ -67,6 +68,7 @@ class WC_Deprecated_Filter_Hooks extends WC_Deprecated_Hooks {
* @var array
*/
protected $deprecated_version = array(
'woocommerce_my_account_my_orders_columns' => '2.6.0',
'woocommerce_email_order_schema_markup' => '3.0.0',
'add_to_cart_fragments' => '3.0.0',
'add_to_cart_redirect' => '3.0.0',

View File

@ -190,7 +190,13 @@ function wc_get_account_endpoint_url( $endpoint ) {
* @return array
*/
function wc_get_account_orders_columns() {
$columns = apply_filters(
/**
* Filters the array of My Account > Orders columns.
*
* @since 2.6.0
* @param array $columns Array of column labels keyed by column IDs.
*/
return apply_filters(
'woocommerce_account_orders_columns',
array(
'order-number' => __( 'Order', 'woocommerce' ),
@ -200,9 +206,6 @@ function wc_get_account_orders_columns() {
'order-actions' => __( 'Actions', 'woocommerce' ),
)
);
// Deprecated filter since 2.6.0.
return apply_filters( 'woocommerce_my_account_my_orders_columns', $columns );
}
/**