Skip to content

Commit 7773dfa

Browse files
authored
Merge pull request #49 from ocean90/fix/list-method-name
Rename `transient list` method to be consistent with other list commands
2 parents 4ac6efc + 07e40a6 commit 7773dfa

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,71 @@ network|site cache, please see docs for `wp transient`.
517517
$ wp transient type
518518
Transients are saved to the database.
519519

520+
521+
522+
### wp transient list
523+
524+
Lists transients and their values.
525+
526+
~~~
527+
wp transient list [--search=<pattern>] [--exclude=<pattern>] [--network] [--unserialize] [--human-readable] [--fields=<fields>] [--format=<format>]
528+
~~~
529+
530+
**OPTIONS**
531+
532+
[--search=<pattern>]
533+
Use wildcards ( * and ? ) to match transient name.
534+
535+
[--exclude=<pattern>]
536+
Pattern to exclude. Use wildcards ( * and ? ) to match transient name.
537+
538+
[--network]
539+
Get the values of network|site transients. On single site, this is
540+
a specially-named cache key. On multisite, this is a global cache
541+
(instead of local to the site).
542+
543+
[--unserialize]
544+
Unserialize transient values in output.
545+
546+
[--human-readable]
547+
Human-readable output for expirations.
548+
549+
[--fields=<fields>]
550+
Limit the output to specific object fields.
551+
552+
[--format=<format>]
553+
The serialization format for the value.
554+
---
555+
default: table
556+
options:
557+
- table
558+
- json
559+
- csv
560+
- count
561+
- yaml
562+
---
563+
564+
**AVAILABLE FIELDS**
565+
566+
This field will be displayed by default for each matching option:
567+
568+
* name
569+
* value
570+
* expiration
571+
572+
**EXAMPLES**
573+
574+
# List all transients
575+
$ wp transient list
576+
+------+-------+---------------+
577+
| name | value | expiration |
578+
+------+-------+---------------+
579+
| foo | bar | 39 mins |
580+
| foo2 | bar2 | no expiration |
581+
| foo3 | bar2 | expired |
582+
| foo4 | bar4 | 4 hours |
583+
+------+-------+---------------+
584+
520585
## Installing
521586

522587
This package is included with WP-CLI itself, no additional installation necessary.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"transient delete",
4343
"transient get",
4444
"transient set",
45-
"transient type"
45+
"transient type",
46+
"transient list"
4647
]
4748
},
4849
"autoload": {

src/Transient_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public function type() {
292292
*
293293
* @subcommand list
294294
*/
295-
public function _list( $args, $assoc_args ) {
295+
public function list_( $args, $assoc_args ) {
296296
global $wpdb;
297297

298298
$network = Utils\get_flag_value( $assoc_args, 'network', false );

0 commit comments

Comments
 (0)