WordPress.org

Make WordPress Core

Ticket #9773: 9773.diff

File 9773.diff, 932 bytes (added by Denis-de-Bernardy, 9 years ago)
  • wp-includes/cache.php

     
    6767 * @uses $wp_object_cache Object Cache Class
    6868 * @see WP_Object_Cache::flush()
    6969 *
     70 * @param string $flag use to partially flush the cache
    7071 * @return bool Always returns true
    7172 */
    72 function wp_cache_flush() {
     73function wp_cache_flush($flag = '') {
    7374        global $wp_object_cache;
    7475
    75         return $wp_object_cache->flush();
     76        return $wp_object_cache->flush($flag);
    7677}
    7778
    7879/**
     
    279280         *
    280281         * @since 2.0.0
    281282         *
     283         * @param string $group use to partially flush the cache
    282284         * @return bool Always returns true
    283285         */
    284         function flush() {
    285                 $this->cache = array ();
     286        function flush($group = '') {
     287                if ( !empty($group) ) {
     288                        $this->cache[$group] = array();
     289                } else {
     290                        $this->cache = array();
     291                }
    286292
    287293                return true;
    288294        }