]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/cache.php
Wordpress 3.7
[autoinstalls/wordpress.git] / wp-includes / cache.php
index af1c2adac9555083bf6cf42c4b03fb4a4ae8755b..f517d124254122fd1cbe2e36298d2306a1813600 100644 (file)
  * @param int $expire When the cache data should be expired
  * @return bool False if cache key and group already exist, true on success
  */
-function wp_cache_add($key, $data, $group = '', $expire = 0) {
+function wp_cache_add( $key, $data, $group = '', $expire = 0 ) {
        global $wp_object_cache;
 
-       return $wp_object_cache->add($key, $data, $group, $expire);
+       return $wp_object_cache->add( $key, $data, $group, (int) $expire );
 }
 
 /**
@@ -154,10 +154,10 @@ function wp_cache_init() {
  * @param int $expire When to expire the cache contents
  * @return bool False if not exists, true if contents were replaced
  */
-function wp_cache_replace($key, $data, $group = '', $expire = 0) {
+function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
        global $wp_object_cache;
 
-       return $wp_object_cache->replace($key, $data, $group, $expire);
+       return $wp_object_cache->replace( $key, $data, $group, (int) $expire );
 }
 
 /**
@@ -173,10 +173,10 @@ function wp_cache_replace($key, $data, $group = '', $expire = 0) {
  * @param int $expire When to expire the cache contents
  * @return bool False on failure, true on success
  */
-function wp_cache_set($key, $data, $group = '', $expire = 0) {
+function wp_cache_set( $key, $data, $group = '', $expire = 0 ) {
        global $wp_object_cache;
 
-       return $wp_object_cache->set($key, $data, $group, $expire);
+       return $wp_object_cache->set( $key, $data, $group, (int) $expire );
 }
 
 /**
@@ -320,7 +320,7 @@ class WP_Object_Cache {
         * @param int $expire When to expire the cache contents
         * @return bool False if cache key and group already exist, true on success
         */
-       function add( $key, $data, $group = 'default', $expire = '' ) {
+       function add( $key, $data, $group = 'default', $expire = 0 ) {
                if ( wp_suspend_cache_addition() )
                        return false;
 
@@ -334,7 +334,7 @@ class WP_Object_Cache {
                if ( $this->_exists( $id, $group ) )
                        return false;
 
-               return $this->set($key, $data, $group, $expire);
+               return $this->set( $key, $data, $group, (int) $expire );
        }
 
        /**
@@ -509,7 +509,7 @@ class WP_Object_Cache {
         * @param int $expire When to expire the cache contents
         * @return bool False if not exists, true if contents were replaced
         */
-       function replace( $key, $data, $group = 'default', $expire = '' ) {
+       function replace( $key, $data, $group = 'default', $expire = 0 ) {
                if ( empty( $group ) )
                        $group = 'default';
 
@@ -520,7 +520,7 @@ class WP_Object_Cache {
                if ( ! $this->_exists( $id, $group ) )
                        return false;
 
-               return $this->set( $key, $data, $group, $expire );
+               return $this->set( $key, $data, $group, (int) $expire );
        }
 
        /**
@@ -559,7 +559,7 @@ class WP_Object_Cache {
         * @param int $expire Not Used
         * @return bool Always returns true
         */
-       function set($key, $data, $group = 'default', $expire = '') {
+       function set( $key, $data, $group = 'default', $expire = 0 ) {
                if ( empty( $group ) )
                        $group = 'default';