Ejemplo n.º 1
0
 public static function flush($flush_persistent = false)
 {
     global $wpdb;
     self::$_cache = array();
     if (false === $flush_persistent) {
         return true;
     }
     if (is_multisite()) {
         $sql = "\r\n                 DELETE FROM {$wpdb->sitemeta}\r\n                 WHERE meta_key LIKE '_site_transient_timeout_GFCache_%' OR\r\n                 meta_key LIKE '_site_transient_GFCache_%'\r\n                ";
     } else {
         $sql = "\r\n                 DELETE FROM {$wpdb->options}\r\n                 WHERE option_name LIKE '_transient_timeout_GFCache_%' OR\r\n                 option_name LIKE '_transient_GFCache_%'\r\n                ";
     }
     $rows_deleted = $wpdb->query($sql);
     $success = $rows_deleted !== false ? true : false;
     return $success;
 }