Recent

Discussions_Commandclass

Discussions_Command

Open or close comments or pingbacks/trackbacks with explicit filters.

Namespace: WebberZone\AutoClose\CLI
Since: 3.2.0
Source: includes/cli/class-discussions-command.php line 21 Extends: Base_Command

Methods

__construct()

Constructor.

Since: 3.2.0
Line: 45

public function __construct( string $type, $comments = ... );
Type Name Description
string $type Discussion type: comment or ping.
Comments|null $comments Discussion processor.

close()

Close matching discussions.

OPTIONS

[…] : Post IDs. Omit to operate on every matching public non-attachment post type supporting the selected discussion type.

[–post-ids=] : Comma-separated post IDs. Can be used instead of positional IDs.

[–age=] : Only match posts older than this many days. Default: 0 (no age filter).

[–post-types=] : Comma-separated post types to include. Default: public post types supporting the selected discussion type.

[–exclude-terms=] : Comma-separated term taxonomy IDs to exclude.

[–dry-run] : Report matching posts without changing content.

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

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

EXAMPLES

wp autoclose comments close --age=90 --post-types=post,page
wp autoclose comments close 1234 5678
wp autoclose comments close --dry-run --format=json

Since: 3.2.0
Line: 104

public function close( $args, $assoc_args ): void;
Type Name Description
array $args Positional arguments.
array $assoc_args Associative arguments.

Returns: void

open()

Open matching discussions.

OPTIONS

[…] : Post IDs. Omit to operate on every matching public non-attachment post type supporting the selected discussion type.

[–post-ids=] : Comma-separated post IDs. Can be used instead of positional IDs.

[–age=] : Only match posts older than this many days. Default: 0 (no age filter).

[–post-types=] : Comma-separated post types to include. Default: public post types supporting the selected discussion type.

[–exclude-terms=] : Comma-separated term taxonomy IDs to exclude.

[–dry-run] : Report matching posts without changing content.

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

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

EXAMPLES

wp autoclose comments open 1234
wp autoclose pings open --post-types=post

Since: 3.2.0
Line: 147

public function open( $args, $assoc_args ): void;
Type Name Description
array $args Positional arguments.
array $assoc_args Associative arguments.

Returns: void