[wp-trac] [WordPress Trac] #54771: possible disagreement in the return types/values wp_cache_flush() and WP_Object_Cache:flush().

WordPress Trac noreply at wordpress.org
Sun Jan 9 18:26:11 UTC 2022


#54771: possible disagreement in the return types/values wp_cache_flush() and
WP_Object_Cache:flush().
--------------------------+-----------------------------
 Reporter:  pbiron        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  low           |  Milestone:  Awaiting Review
Component:  Cache API     |    Version:
 Severity:  normal        |   Keywords:
  Focuses:  docs          |
--------------------------+-----------------------------
 [https://developer.wordpress.org/reference/classes/wp_object_cache/flush/
 WP_Object_Cache::flush()] always returns true.

 [https://developer.wordpress.org/reference/functions/wp_cache_flush/
 wp_cache_flush()]  returns the value of calling
 `WP_Object_Cache::flush()`.  But, the DocBlock of `wp_cache_flush()` lists
 the return as:

 > True on success, false on failure.

 Is this discrepancy just a mistake, or is it because of the possibility of
 an object caching plugin returning something different?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54771>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list