Make WordPress Core


Ignore:
Timestamp:
07/23/2022 02:56:51 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Cache API: Make the placement of wp_cache_flush_group() more consistent.

Includes:

  • Placing WP_Object_Cache::flush_group() next to ::flush().
  • Placing wp_cache_supports_group_flush() next to wp_cache_flush_group().
  • Placing the wp_cache_flush_group() unit test next to the ::flush() method test.
  • Removing test name from assertion messages, as it is already mentioned directly above in case of failure.
  • Adjusting function descriptions per the documentation standards.

Follow-up to [52706], [53763].

See #55647, #4476.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-object-cache.php

    r53763 r53767  
    292292
    293293        /**
    294          * Removes all cache items in a group.
    295          *
    296          * @since 6.1.0
    297          *
    298          * @param string $group Name of group to remove from cache.
    299          * @return true Always returns true.
    300          */
    301         public function flush_group( $group ) {
    302                 unset( $this->cache[ $group ] );
    303 
    304                 return true;
    305         }
    306 
    307         /**
    308294         * Retrieves the cache contents, if it exists.
    309295         *
    … …  
    511497
    512498        /**
     499         * Removes all cache items in a group.
     500         *
     501         * @since 6.1.0
     502         *
     503         * @param string $group Name of group to remove from cache.
     504         * @return true Always returns true.
     505         */
     506        public function flush_group( $group ) {
     507                unset( $this->cache[ $group ] );
     508
     509                return true;
     510        }
     511
     512        /**
    513513         * Sets the list of global cache groups.
    514514         *
Note: See TracChangeset for help on using the changeset viewer.