|
1 |
| -Revisions CLI |
2 |
| -============= |
| 1 | +# Revisions CLI |
3 | 2 |
|
4 |
| -Requires [wp-cli](http://wp-cli.org). |
| 3 | +WP CLI command for managing revisions |
5 | 4 |
|
6 |
| -Install this as a normal plugin, then run `wp help revisions` |
| 5 | +## Installation |
7 | 6 |
|
| 7 | +### as standard plugin |
| 8 | + |
| 9 | +``` |
| 10 | +wp plugin install https://github.com/trepmal/wp-revisions-cli/archive/master.zip --activate |
| 11 | +``` |
| 12 | + |
| 13 | +### as wp-cli package (coming soooooooon, hopefully) |
| 14 | + |
| 15 | +``` |
| 16 | +# wp package install trepmal/wp-revisions-cli |
8 | 17 | ```
|
9 |
| -clean Clean out old revisions |
10 |
| -dump Dump all revisions |
11 |
| -generate Generate revisions |
12 |
| -list List all revisions |
13 |
| -status Get revision status |
14 |
| -``` |
| 18 | + |
| 19 | +## Usage |
| 20 | + |
| 21 | + |
| 22 | +For a rundown of all commands at any time, run `wp help revisions` |
| 23 | + |
| 24 | + |
| 25 | +### `wp revisions clean [<keep>]` |
| 26 | + |
| 27 | +`<keep>` is an integer, defaults to value of `WP_POST_REVISIONS` |
| 28 | + |
| 29 | +For all posts, keep only the last *keep* revisions for all posts. |
| 30 | + |
| 31 | + - `--post_type=<post_type>` Clean revisions for given post type |
| 32 | + - `--post_id=<post_id>` Clean revisions for given post. (Does not yet accept lists) |
| 33 | + - `--hard` use `wp_delete_post_revision()` when deleting, this picks up any potential related data such as meta or comments. |
| 34 | + |
| 35 | +### `wp revisions dump` |
| 36 | + |
| 37 | +Dump all revisions for all posts. Equivalent to `wp revisions clean -1` |
| 38 | + |
| 39 | + - `--hard` use `wp_delete_post_revision()` when deleting, this picks up any potential related data such as meta or comments. |
| 40 | + - `--yes` answer 'yes' to confirmation message |
| 41 | + |
| 42 | +### `wp revisions generate [<count>]` |
| 43 | + |
| 44 | +`<count>` *integer* Number of revisions to generate per post. Default 15 |
| 45 | + |
| 46 | +Generate revisions for posts. |
| 47 | + |
| 48 | + - `--post_type=<post_type>` Generate revisions for given post type |
| 49 | + - `--post_id=<post_id>` Generate revisions for given post. (Does not yet accept lists) |
| 50 | + |
| 51 | +### `wp revisions list` |
| 52 | + |
| 53 | +List revisions. |
| 54 | + |
| 55 | + - `--post_type=<post_type>` Generate revisions for given post type |
| 56 | + - `--post_id=<post_id>` Generate revisions for given post. (Does not yet accept lists) |
| 57 | + - `--yes` answer 'yes' to confirmation message |
| 58 | + |
| 59 | +### `wp revisions status` |
| 60 | + |
| 61 | +Get revisions status. Namely, the value of `WP_POST_REVISIONS` |
| 62 | + |
| 63 | + |
| 64 | +## Credits |
| 65 | + |
| 66 | +## License |
| 67 | + |
| 68 | +The MIT License (MIT) |
| 69 | +Copyright (c) 2016 Kailey Lampert |
| 70 | +[Full text license](LICENSE) |
0 commit comments