From 629c633aa3e9dbce00a54921c57ef078bfbb21a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20G=C3=A4chter?= Date: Mon, 9 Sep 2024 17:51:55 +0200 Subject: [PATCH] feat!: Deprecate timber/integration/woocommerce/product filter in favor of timber/woocommerce/product (#50) --- lib/Product.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/Product.php b/lib/Product.php index 85c7084..fa04d40 100644 --- a/lib/Product.php +++ b/lib/Product.php @@ -54,10 +54,22 @@ public static function build( WP_Post $wp_post): static { $product = wc_get_product( $post->ID ); } + $product = apply_filters_deprecated( + 'timber/integration/woocommerce/product', + [ $product, $post ], + '1.1.0', + 'timber/woocommerce/product' + ); + /** - * Filters the WooCommerce product + * Filters the WooCommerce product. + * + * @since 1.1.0 + * + * @param \WC_Product $product The WooCommerce product. + * @param \WP_Post $post The WordPress post. */ - $product = apply_filters( 'timber/integration/woocommerce/product', $product, $post ); + $product = apply_filters( 'timber/woocommerce/product', $product, $post ); $post->product = $product;