Updates bonanza

This commit is contained in:
nikolark committed 2014-07-24 14:38:32 +02:00
1 parent d26191c9f8
commit 9d480fc3c5
1366 files changed
+220321 -90180

No files matched your search

+23 -24
View File
@@ -19,12 +19,12 @@
* @param mixed $data The data to add to the cache store
* @param string $group The group to add the cache to
* @param int $expire When the cache data should be expired
* @return unknown
* @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 );
}
/**
@@ -85,7 +85,7 @@ function wp_cache_delete($key, $group = '') {
* @uses $wp_object_cache Object Cache Class
* @see WP_Object_Cache::flush()
*
* @return bool Always returns true
* @return bool False on failure, true on success
*/
function wp_cache_flush() {
global $wp_object_cache;
@@ -152,18 +152,19 @@ function wp_cache_init() {
* @param mixed $data The contents to store in the cache
* @param string $group Where to group the cache contents
* @param int $expire When to expire the cache contents
* @return bool False if cache key and group already exist, true on success
* @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 );
}
/**
* Saves the data to the cache.
*
* @since 2.0
* @since 2.0.0
*
* @uses $wp_object_cache Object Cache Class
* @see WP_Object_Cache::set()
*
@@ -171,12 +172,12 @@ function wp_cache_replace($key, $data, $group = '', $expire = 0) {
* @param mixed $data The contents to store in the cache
* @param string $group Where to group the cache contents
* @param int $expire When to expire the cache contents
* @return bool False if cache key and group already exist, true on success
* @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 );
}
/**
@@ -256,7 +257,7 @@ function wp_cache_reset() {
*
* @package WordPress
* @subpackage Cache
* @since 2.0
* @since 2.0.0
*/
class WP_Object_Cache {
@@ -320,7 +321,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 +335,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 );
}
/**
@@ -387,26 +388,24 @@ class WP_Object_Cache {
/**
* Remove the contents of the cache key in the group
*
* If the cache key does not exist in the group and $force parameter is set
* to false, then nothing will happen. The $force parameter is set to false
* by default.
* If the cache key does not exist in the group, then nothing will happen.
*
* @since 2.0.0
*
* @param int|string $key What the contents in the cache are called
* @param string $group Where the cache contents are grouped
* @param bool $force Optional. Whether to force the unsetting of the cache
* key in the group
* @param bool $deprecated Deprecated.
*
* @return bool False if the contents weren't deleted and true on success
*/
function delete($key, $group = 'default', $force = false) {
function delete( $key, $group = 'default', $deprecated = false ) {
if ( empty( $group ) )
$group = 'default';
if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
$key = $this->blog_prefix . $key;
if ( ! $force && ! $this->_exists( $key, $group ) )
if ( ! $this->_exists( $key, $group ) )
return false;
unset( $this->cache[$group][$key] );
@@ -509,7 +508,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 +519,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 +558,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';