Update the WP-CLI clear subcommand to check for an empty string instead of using the empty() function. This will make it so wp cache-enabler clear --ids=0, wp cache-enabler clear --urls=0, and wp cache-enabler clear --sites=0 will not clear the complete cache. wp cache-enabler clear --sites=0 will now clear the current blog ID due to how the get_site() function works, while the others will now not clear anything.
The status returned by WP-CLI will be improved when the return handling is improved across the code base (due to the changes introduced with the new cache iterator). That will allow WP-CLI to indicate whether or not the cache was actually cleared. For now the status being returned stays as it has been.
Add an empty() check to the cache iterator to prevent the Cache_Enabler_Disk::get_cache_dir() method from returning the cache directory to the currently requested URL (updating what was initially added in PR #237).
Update the WP-CLI
clear
subcommand to check for an empty string instead of using theempty()
function. This will make it sowp cache-enabler clear --ids=0
,wp cache-enabler clear --urls=0
, andwp cache-enabler clear --sites=0
will not clear the complete cache.wp cache-enabler clear --sites=0
will now clear the current blog ID due to how theget_site()
function works, while the others will now not clear anything.The status returned by WP-CLI will be improved when the return handling is improved across the code base (due to the changes introduced with the new cache iterator). That will allow WP-CLI to indicate whether or not the cache was actually cleared. For now the status being returned stays as it has been.
Add an
empty()
check to the cache iterator to prevent theCache_Enabler_Disk::get_cache_dir()
method from returning the cache directory to the currently requested URL (updating what was initially added in PR #237).