twitter_stream_delete_cache

The Twitter Stream twitter stream delete cache function.

Description

twitter_stream_delete_cache(); 

Usage

  1. if ( !function_exists( 'twitter_stream_delete_cache' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'twitter-stream/twitter-stream.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twitter_stream_delete_cache(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/twitter-stream.php  
  1. function twitter_stream_delete_cache() { 
  2.  
  3. $cache_path = dirname(__FILE__); 
  4.  
  5. if ($handle = opendir($cache_path)) { 
  6.  
  7. while (false !== ($file = readdir($handle))) { 
  8. if(FALSE !== stristr($file, '.cache')) { 
  9. unlink($cache_path.'/'.$file); 
  10. $deleted = true; 
  11. break; 
  12.  
  13. closedir($handle); 
  14. if($deleted === true) { 
  15. header('Location: ' . preg_replace('/&wptwit-page=[^&]*/', '', $_SERVER['REQUEST_URI']) . '&wptwit-page=cachedeleted'); 
  16. } else { 
  17. header('Location: ' . preg_replace('/&wptwit-page=[^&]*/', '', $_SERVER['REQUEST_URI']) . '&wptwit-page=cachefailed'); 
  18.