Example #1
0
 /**
  * If FeedBurner is enabled flush the registered FB feeds
  */
 function flush_feedburner($post_id)
 {
     if (!w3_is_flushable_post($post_id, 'pgcache', $this->_config)) {
         return;
     }
     $fb_urls = w3tc_get_extension_config('feedburner', 'urls');
     if ($fb_urls) {
         $fb_urls = explode("\n", $fb_urls);
     }
     $fb_urls[] = home_url();
     foreach ($fb_urls as $url) {
         wp_remote_get('http://feedburner.google.com/fb/a/pingSubmit?bloglink=' . urlencode($url));
     }
 }
Example #2
0
 /**
  * Post change action
  *
  * @param integer $post_id
  * @param null $post
  * @return void
  */
 function on_post_change($post_id, $post = null)
 {
     static $flushed_posts = array();
     if (!in_array($post_id, $flushed_posts)) {
         if (is_null($post)) {
             $post = $post_id;
         }
         if (!w3_is_flushable_post($post, 'cdncache', $this->_config)) {
             return;
         }
         $w3_cacheflush = w3_instance('W3_CacheFlush');
         $w3_cacheflush->cdncache_purge_post($post_id);
         $flushed_posts[] = $post_id;
     }
 }
Example #3
0
 /**
  * Change post action
  */
 function on_post_change($post_id = 0, $post = null)
 {
     static $flushed = false;
     if (!$flushed) {
         if (is_null($post)) {
             $post = $post_id;
         }
         if ($post_id > 0 && !w3_is_flushable_post($post, 'objectcache', $this->_config)) {
             return;
         }
         $flush = w3_instance('W3_CacheFlush');
         $flush->objectcache_flush();
         $flushed = true;
     }
 }