Update tweaks for coen

This commit is contained in:
Mike Jolley 2013-03-06 11:59:24 +00:00
parent 36e4cd8fa1
commit eb8c37844b
2 changed files with 13 additions and 4 deletions

View File

@ -98,7 +98,7 @@ class WC_Session_Handler extends WC_Session {
* @return mixed
*/
private function get_session_cookie() {
if ( ! isset( $_COOKIE[ $this->_cookie ] ) )
if ( empty( $_COOKIE[ $this->_cookie ] ) )
return false;
list( $customer_id, $session_expiration, $session_expiring, $cookie_hash ) = explode( '||', $_COOKIE[ $this->_cookie ] );

View File

@ -132,9 +132,8 @@ class Woocommerce {
// Installation
register_activation_hook( __FILE__, array( $this, 'activate' ) );
// Upgrades
if ( is_admin() && ( get_option( 'woocommerce_version' ) != $this->version || get_option( 'woocommerce_db_version' ) != $this->version ) )
add_action( 'admin_init', array( $this, 'install' ), 1 );
// Updates
add_action( 'admin_init', array( $this, 'update' ), 5 );
// Include required files
$this->includes();
@ -241,6 +240,16 @@ class Woocommerce {
$this->install();
}
/**
* update function.
*
* @access public
* @return void
*/
public function update() {
if ( ! defined( 'IFRAME_REQUEST' ) && ( get_option( 'woocommerce_version' ) != $this->version || get_option( 'woocommerce_db_version' ) != $this->version ) )
$this->install();
}
/**
* upgrade function.