CLI_Cache_Command::cache_clear()
Clears the internal cache.
EXAMPLES
$ wp cli cache clear Success: Cache cleared.
Method of the class: CLI_Cache_Command{}
No Hooks.
Return
null
. Nothing (null).
Usage
$CLI_Cache_Command = new CLI_Cache_Command(); $CLI_Cache_Command->cache_clear();
CLI_Cache_Command::cache_clear() CLI Cache Command::cache clear code WP-CLI 2.8.0-alpha
public function cache_clear() { $cache = WP_CLI::get_cache(); if ( ! $cache->is_enabled() ) { WP_CLI::error( 'Cache directory does not exist.' ); } $cache->clear(); WP_CLI::success( 'Cache cleared.' ); }