Update tweaks for coen
This commit is contained in:
parent
36e4cd8fa1
commit
eb8c37844b
|
@ -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 ] );
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue