當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GADWP_Tools::clear_transients方法代碼示例

本文整理匯總了PHP中GADWP_Tools::clear_transients方法的典型用法代碼示例。如果您正苦於以下問題:PHP GADWP_Tools::clear_transients方法的具體用法?PHP GADWP_Tools::clear_transients怎麽用?PHP GADWP_Tools::clear_transients使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GADWP_Tools的用法示例。


在下文中一共展示了GADWP_Tools::clear_transients方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: maintain_compatibility

 private function maintain_compatibility()
 {
     $flag = false;
     if (GADWP_CURRENT_VERSION != get_option('gadwp_version')) {
         $rebuild_token = json_decode($this->options['ga_dash_token']);
         // v4.8.2
         if (is_object($rebuild_token) && !isset($rebuild_token->token_type)) {
             if (isset($this->options['ga_dash_refresh_token'])) {
                 $rebuild_token->refresh_token = $this->options['ga_dash_refresh_token'];
             }
             $rebuild_token->token_type = "Bearer";
             $this->options['ga_dash_token'] = json_encode($rebuild_token);
             unset($this->options['ga_dash_refresh_token']);
             $this->set_plugin_options(true);
         } else {
             unset($this->options['ga_dash_refresh_token']);
         }
         GADWP_Tools::clear_cache();
         GADWP_Tools::clear_transients();
         // 4.8.3 to be removed after a few months
         $flag = true;
         GADWP_Tools::delete_cache('last_error');
         update_option('gadwp_version', GADWP_CURRENT_VERSION);
         update_option('gadwp_got_updated', true);
         if (is_multisite()) {
             // Cleanup errors and cookies on the entire network
             foreach (wp_get_sites(array('limit' => apply_filters('gadwp_sites_limit', 100))) as $blog) {
                 switch_to_blog($blog['blog_id']);
                 GADWP_Tools::delete_cache('gapi_errors');
                 restore_current_blog();
             }
         } else {
             GADWP_Tools::delete_cache('gapi_errors');
         }
         GADWP_Tools::unset_cookie('default_metric');
         GADWP_Tools::unset_cookie('default_dimension');
     }
     if (!isset($this->options['ga_enhanced_links'])) {
         $this->options['ga_enhanced_links'] = 0;
         $flag = true;
     }
     if (!isset($this->options['ga_dash_network'])) {
         $this->options['ga_dash_network'] = 0;
         $flag = true;
     }
     if (!isset($this->options['ga_enhanced_excludesa'])) {
         $this->options['ga_dash_excludesa'] = 0;
         $flag = true;
     }
     if (!isset($this->options['ga_dash_remarketing'])) {
         $this->options['ga_dash_remarketing'] = 0;
         $flag = true;
     }
     if (!isset($this->options['ga_dash_adsense'])) {
         $this->options['ga_dash_adsense'] = 0;
         $flag = true;
     }
     if (!isset($this->options['ga_speed_samplerate'])) {
         $this->options['ga_speed_samplerate'] = 1;
         $flag = true;
     }
     if (!isset($this->options['automatic_updates_minorversion'])) {
         $this->options['automatic_updates_minorversion'] = 1;
         $flag = true;
     }
     if (!isset($this->options['ga_event_bouncerate'])) {
         $this->options['ga_event_bouncerate'] = 0;
         $flag = true;
     }
     if (!is_array($this->options['ga_dash_access_front']) || empty($this->options['ga_dash_access_front'])) {
         $this->options['ga_dash_access_front'] = array();
         $this->options['ga_dash_access_front'][] = 'administrator';
         $flag = true;
     }
     if (!is_array($this->options['ga_dash_profile_list'])) {
         $this->options['ga_dash_profile_list'] = array();
         $flag = true;
     }
     if (!is_array($this->options['ga_dash_access_back']) || empty($this->options['ga_dash_access_back'])) {
         $this->options['ga_dash_access_back'] = array();
         $this->options['ga_dash_access_back'][] = 'administrator';
         $flag = true;
     }
     if (!is_array($this->options['ga_track_exclude'])) {
         $this->options['ga_track_exclude'] = array();
         $flag = true;
     }
     if (!isset($this->options['ga_crossdomain_tracking'])) {
         $this->options['ga_crossdomain_tracking'] = 0;
         $flag = true;
     }
     if (!isset($this->options['ga_crossdomain_list'])) {
         $this->options['ga_crossdomain_list'] = '';
         $flag = true;
     }
     if (!isset($this->options['ga_author_dimindex'])) {
         $this->options['ga_author_dimindex'] = 0;
         $flag = true;
     }
     if (!isset($this->options['ga_category_dimindex'])) {
//.........這裏部分代碼省略.........
開發者ID:linniepinski,項目名稱:perssistant,代碼行數:101,代碼來源:config.php


注:本文中的GADWP_Tools::clear_transients方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。