-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Be explicit for no results when using wp transient list and external object cache #61
Comments
The |
This was a real head-scratcher when I encountered it today. If you're using Redis (for example) you can do something like |
Adding a guard clause of |
@GaryJones Want to submit a pull request for what you might suggest? |
@danielbachhuber It's not something I'm going to get around to anytime soon, so please go ahead :-) |
When using an external object cache, transients are stored in the object cache and not in the database.
wp transient get ...
will still work correctly, as it wraps theget_transient()
orget_site_transient()
functions.However,
wp transient list
will always return an empty table, as the handler for the WP-CLI command generates some SQL to explicitly look in the options or sitemeta tables, which will be empty of transients.Could we have an early guard clause for the
list()
method that reminds users that transients are stored in the object cache and so can't be displayed, if the object cache is being used?(At least until WP core has
get_transients()
function that can be wrapped.)The text was updated successfully, but these errors were encountered: