From 2e68ca7d2fe148e11636afa1100505628d465c2c Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Thu, 6 Jun 2013 14:41:15 +0200 Subject: [PATCH] Property cleanup and deprecation --- classes/helpers/class-wc-template-helper.php | 2 ++ woocommerce.php | 29 +++++++------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/classes/helpers/class-wc-template-helper.php b/classes/helpers/class-wc-template-helper.php index b93f3a9a3f1..031e040a29f 100644 --- a/classes/helpers/class-wc-template-helper.php +++ b/classes/helpers/class-wc-template-helper.php @@ -3,6 +3,8 @@ return new WC_Template_Helper(); class WC_Template_Helper extends WC_Helper { + public $template_url; + public function __construct() { $this->template_url = apply_filters( 'woocommerce_template_url', 'woocommerce/' ); } diff --git a/woocommerce.php b/woocommerce.php index 19c5b2d2116..dd80abe58a6 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -49,11 +49,6 @@ class Woocommerce { */ public $plugin_path; - /** - * @var string - */ - public $template_url; - /** * @var array */ @@ -104,11 +99,6 @@ class Woocommerce { */ public $integrations; - /** - * @var string - */ - private $_inline_js = ''; - /** * WooCommerce Constructor. @@ -178,16 +168,17 @@ class Woocommerce { * @return mixed */ public function __get( $key ) { - - if ( 'payment_gateways' == $key ) { - return $this->payment_gateways(); + switch( $key ) { + case 'payment_gateways': + return $this->payment_gateways(); + case 'shipping': + return $this->shipping(); + case 'template_url': + _deprecated_argument( 'Woocommerce->template_url', '2.1', 'The "template_url" field is moved to the template helper class.' ); + return $this->get_helper( 'template' )->template_url; + default: + return false; } - - elseif ( 'shipping' == $key ) { - return $this->shipping(); - } - - return false; } /**