lukecav / wp-revisions-cli

WP-CLI command. Manage post revisions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Revisions CLI Build Status

WP CLI command for managing revisions

Installation

as wp-cli package (recommended)

wp package install trepmal/wp-revisions-cli

as standard plugin (for older installations of wp-cli)

wp plugin install https://github.com/trepmal/wp-revisions-cli/archive/master.zip --activate

Usage

For a rundown of all commands at any time, run wp help revisions

wp revisions clean [<keep>]

For all posts, keep only the last <keep> revisions for all posts.

  • <keep> integer. Defaults to value of WP_POST_REVISIONS
  • --post_type=<post_type> string. Clean revisions for given post type. Default any
  • --post_id=<post_id> integer. Clean revisions for given post. (Does not yet accept lists)
  • --after-date=<date> string. Clean revisions published on or after this date. Use YYYY-MM-DD
  • --before-date=<date> string. Clean revisions published on or before this date. Use YYYY-MM-DD
  • --hard use wp_delete_post_revision() when deleting, this picks up any potential related data such as meta or comments.

wp revisions dump

Dump all revisions for all posts. Faster than wp revisions clean -1 since it doesn't query each post.

  • --hard Slower. Uses wp_delete_post_revision() when deleting, this picks up any potential related data such as meta or comments. Equivalent to wp revisions clean -1 --hard
  • --yes answer yes to confirmation message

wp revisions generate [<count>]

Generate revisions for posts.

  • <count> integer. Number of revisions to generate per post. Default 15
  • --post_type=<post_type> string. Generate revisions for given post type. Default any
  • --post_id=<post_id> integer. Generate revisions for given post. (Does not yet accept lists)

wp revisions list

List revisions.

  • --post_type=<post_type> string. Generate revisions for given post type. Default any
  • --post_id=<post_id> integer. Generate revisions for given post. (Does not yet accept lists)
  • --yes answer yes to confirmation message

wp revisions status

Get revisions status. Namely, the value of WP_POST_REVISIONS

Credits

License

The MIT License (MIT)
Copyright (c) 2016 Kailey Lampert
Full text license

About

WP-CLI command. Manage post revisions.

License:MIT License


Languages

Language:PHP 95.3%Language:Gherkin 3.2%Language:Shell 1.5%