Property cleanup and deprecation

This commit is contained in:
Coen Jacobs 2013-06-06 14:41:15 +02:00
parent c98a240913
commit 2e68ca7d2f
2 changed files with 12 additions and 19 deletions

View File

@ -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/' );
}

View File

@ -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;
}
/**