Skip to content

Commit

Permalink
feat!: Deprecate theme/woocommerce/views_folder filter in favor of …
Browse files Browse the repository at this point in the history
…`timber/woocommerce/views_folder`
  • Loading branch information
gchtr committed Sep 10, 2024
1 parent 359eddb commit ac58e4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ],
Expand Down
11 changes: 10 additions & 1 deletion lib/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit ac58e4f

Please sign in to comment.