From 9d30ad15fad73543ee8b34f5715222c9c26db36e Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 8 May 2012 17:29:22 +0100 Subject: [PATCH] wootrans opt in --- .../wootransmitter/classes/wootransmitter.class.php | 2 +- woocommerce.php | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/classes/integrations/wootransmitter/classes/wootransmitter.class.php b/classes/integrations/wootransmitter/classes/wootransmitter.class.php index cb6232bc0b8..e1d9213462c 100644 --- a/classes/integrations/wootransmitter/classes/wootransmitter.class.php +++ b/classes/integrations/wootransmitter/classes/wootransmitter.class.php @@ -19,7 +19,7 @@ class WooThemes_Transmitter { $this->assets_url = $this->get_assets_url( $file ); $this->transient_expire_time = 60 * 60 * 24; // 24 Hours. $this->app_keys = array(); - $this->is_enabled = get_option( $this->token . '-status', true ); + $this->is_enabled = get_option( $this->token . '-status', false ); // Initialise the script. add_action( 'init', array( &$this, 'init' ) ); diff --git a/woocommerce.php b/woocommerce.php index 3dc13bab3c4..b0e73090134 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -139,16 +139,17 @@ class Woocommerce { include( 'classes/integrations/sharethis/class-wc-sharethis.php' ); include( 'classes/integrations/sharedaddy/class-wc-sharedaddy.php' ); include( 'classes/integrations/shareyourcart/class-wc-shareyourcart.php' ); - include( 'classes/integrations/wootransmitter/wootransmitter.php' ); } /** * Set up WooTransmitter Notifications **/ function wootransmitter_init() { - global $wootransmitter; - - $wootransmitter->add_app_key( '379cd69e-b1f4-4128-8b66-8f3688ad0fa1', esc_attr( $this->version ) ); + // Include Woo Transmitter + include( 'classes/integrations/wootransmitter/wootransmitter.php' ); + + // Add our app key + $GLOBALS['wootransmitter']->add_app_key( '379cd69e-b1f4-4128-8b66-8f3688ad0fa1', esc_attr( $this->version ) ); } /** @@ -1353,6 +1354,7 @@ class Woocommerce { function clear_product_transients( $post_id = 0 ) { global $wpdb; + delete_transient('wootransmitter-messages'); delete_transient('wc_products_onsale'); delete_transient('wc_hidden_product_ids'); delete_transient('wc_hidden_product_ids_search');