Revisions_Command
Preview, prune, or permanently delete post revisions.
Namespace: WebberZone\AutoClose\CLI
Since: 3.2.0
Source: includes/cli/class-revisions-command.php line 21
Extends: Base_Command
Methods
__construct()
Constructor.
Since: 3.2.0
Line: 37
public function __construct( $revisions = ... );
| Type | Name | Description |
|---|---|---|
Revisions|null |
$revisions |
Revisions processor. |
preview()
Preview revisions without changing content.
OPTIONS
[
[–post-ids=
[–age=
[–all] : Preview the delete-all action instead of the pruning policy.
[–sample=
[–format=
EXAMPLES
wp autoclose revisions preview
wp autoclose revisions preview --age=30
wp autoclose revisions preview 1234 --format=json
wp autoclose revisions preview --all
Since: 3.2.0
Line: 76
public function preview( $args, $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Positional arguments. |
array |
$assoc_args |
Associative arguments. |
Returns: void
prune()
Delete revisions beyond the retention limit and older than the age cutoff.
Autosaves are never removed by this command.
OPTIONS
[
[–post-ids=
[–age=
[–limit=
[–dry-run] : Preview the pruning without changing content.
[–sample=
[–yes] : Skip the confirmation prompt.
[–format=
EXAMPLES
wp autoclose revisions prune --dry-run
wp autoclose revisions prune --age=30 --yes
wp autoclose revisions prune 1234 --format=json
Since: 3.2.0
Line: 123
public function prune( $args, $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Positional arguments. |
array |
$assoc_args |
Associative arguments. |
Returns: void
delete()
Permanently delete every revision, ignoring retention limits and age.
This also removes autosaves. Use prune for ordinary cleanup.
OPTIONS
[
[–post-ids=
[–dry-run] : Preview the deletion without changing content.
[–sample=
[–yes] : Skip the confirmation prompt.
[–format=
EXAMPLES
wp autoclose revisions delete
wp autoclose revisions delete 1234 --yes
wp autoclose revisions delete --dry-run --format=json
Since: 3.2.0
Line: 163
public function delete( $args, $assoc_args ): void;
| Type | Name | Description |
|---|---|---|
array |
$args |
Positional arguments. |
array |
$assoc_args |
Associative arguments. |
Returns: void