From 5dc354fb885c89e32159553ab4cb368de24c3f41 Mon Sep 17 00:00:00 2001 From: Lukas Gaechter Date: Tue, 10 Sep 2024 08:24:25 +0200 Subject: [PATCH] feat!: Deprecate `theme/woocommerce/views_folder` filter in favor of `timber/woocommerce/views_folder` --- lib/Product.php | 3 +++ lib/WooCommerce.php | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Product.php b/lib/Product.php index fa04d40..67e2221 100644 --- a/lib/Product.php +++ b/lib/Product.php @@ -54,6 +54,9 @@ public static function build( WP_Post $wp_post): static { $product = wc_get_product( $post->ID ); } + /** + * @deprecated + */ $product = apply_filters_deprecated( 'timber/integration/woocommerce/product', [ $product, $post ], diff --git a/lib/WooCommerce.php b/lib/WooCommerce.php index e5501f0..57ea6a8 100644 --- a/lib/WooCommerce.php +++ b/lib/WooCommerce.php @@ -36,12 +36,21 @@ class WooCommerce { public static function init() { $self = new self(); + /** + * @deprecated + */ + self::$subfolder = apply_filters_deprecated( + 'theme/woocommerce/views_folder', + ['woocommerce'], + '1.1.0', + 'timber/woocommerce/views_folder' + ); + /** * Filters the subfolder to use in the Twig template file folder. * * @param string $subfolder Subfolder name. */ - self::$subfolder = apply_filters( 'theme/woocommerce/views_folder', 'woocommerce' ); self::$subfolder = apply_filters( 'timber/woocommerce/views_folder', 'woocommerce' ); self::$subfolder = trailingslashit( self::$subfolder );