Check if variable isset to avoid undefined error

This commit is contained in:
Todd Lahman 2013-05-18 23:24:03 -07:00
parent aaa6a6a1e5
commit 3d118b37b2
1 changed files with 2 additions and 2 deletions

View File

@ -1353,7 +1353,7 @@ class Woocommerce {
* @return string
*/
public function plugin_url() {
if ( $this->plugin_url ) return $this->plugin_url;
if ( isset( $this->plugin_url ) ) return $this->plugin_url;
return $this->plugin_url = untrailingslashit( plugins_url( '/', __FILE__ ) );
}
@ -1365,7 +1365,7 @@ class Woocommerce {
* @return string
*/
public function plugin_path() {
if ( $this->plugin_path ) return $this->plugin_path;
if ( isset( $this->plugin_path ) ) return $this->plugin_path;
return $this->plugin_path = untrailingslashit( plugin_dir_path( __FILE__ ) );
}