From 729c2d8447058a91131ef020ba5067ac52da5d65 Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Thu, 6 Jun 2013 15:01:09 +0200 Subject: [PATCH] Cleanup public vars that shouldn't be public --- woocommerce.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/woocommerce.php b/woocommerce.php index dd80abe58a6..14543109ede 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -39,16 +39,6 @@ class Woocommerce { */ public $version = '2.1-bleeding'; - /** - * @var string - */ - public $plugin_url; - - /** - * @var string - */ - public $plugin_path; - /** * @var array */ @@ -162,6 +152,7 @@ class Woocommerce { /** * Auto-load in-accessible properties on demand. + * TODO: Need to find a permanent solution for loading/deprecating these. * * @access public * @param mixed $key @@ -176,6 +167,12 @@ class Woocommerce { 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; + case 'plugin_url': + _deprecated_argument( 'Woocommerce->plugin_url', '2.1', 'The "plugin_url" field is removed, please use the Woocommerce->plugin_url() function.' ); + return $this->plugin_url(); + case 'plugin_path': + _deprecated_argument( 'Woocommerce->plugin_path', '2.1', 'The "plugin_path" field is removed, please use the Woocommerce->plugin_path() function.' ); + return $this->plugin_path(); default: return false; } @@ -901,8 +898,7 @@ class Woocommerce { * @return string */ public function plugin_url() { - if ( isset( $this->plugin_url ) ) return $this->plugin_url; - return $this->plugin_url = untrailingslashit( plugins_url( '/', __FILE__ ) ); + return untrailingslashit( plugins_url( '/', __FILE__ ) ); } @@ -913,9 +909,7 @@ class Woocommerce { * @return string */ public function plugin_path() { - if ( isset( $this->plugin_path ) ) return $this->plugin_path; - - return $this->plugin_path = untrailingslashit( plugin_dir_path( __FILE__ ) ); + return untrailingslashit( plugin_dir_path( __FILE__ ) ); }