Recent

Revisions_Commandclass

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

[…] : Parent post IDs. Omit to include all revisions.

[–post-ids=] : Comma-separated parent post IDs.

[–age=] : Age cutoff in days for the pruning policy. Defaults to the saved setting.

[–all] : Preview the delete-all action instead of the pruning policy.

[–sample=] : Maximum sample rows. Default: 10. Maximum: 100.

[–format=] : Output format. Options: table, json, csv. Default: table.

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

[…] : Parent post IDs. Omit to prune every post.

[–post-ids=] : Comma-separated parent post IDs.

[–age=] : Age cutoff in days. Defaults to the saved setting. Zero ignores age.

[–limit=] : Maximum revisions to delete in this run. Defaults to the filtered plugin limit.

[–dry-run] : Preview the pruning without changing content.

[–sample=] : Maximum sample rows in dry-run output. Default: 10. Maximum: 100.

[–yes] : Skip the confirmation prompt.

[–format=] : Output format. Options: table, json, csv. Default: table.

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

[…] : Parent post IDs. Omit to delete all revisions.

[–post-ids=] : Comma-separated parent post IDs.

[–dry-run] : Preview the deletion without changing content.

[–sample=] : Maximum sample rows in dry-run output. Default: 10. Maximum: 100.

[–yes] : Skip the confirmation prompt.

[–format=] : Output format. Options: table, json, csv. Default: table.

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