Skip to content

Commit 68b4dc9

Browse files
committed
WC 2.1 Compatibility Method
New 2.1 compatibility method to get template path
1 parent 2977e19 commit 68b4dc9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

woocommerce/class-sv-wc-plugin-compatibility.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,23 @@ public static function wc_trim_zeroes( $price ) {
752752
}
753753

754754

755+
/**
756+
* Get the template path
757+
*
758+
* @since 2.0.2
759+
* @return string template path
760+
*/
761+
public static function template_path() {
762+
763+
if ( self::is_wc_version_gte_2_1() ) {
764+
return WC()->template_path();
765+
} else {
766+
global $woocommerce;
767+
return $woocommerce->template_url;
768+
}
769+
}
770+
771+
755772
/**
756773
* Compatibility function to get the version of the currently installed WooCommerce
757774
*

0 commit comments

Comments
 (0)