Recent

Close_Dateclass

Close_Date

Class Close_Date

Handles scheduling and closing logic for comments/trackbacks based on meta. No admin UI/metabox logic here.

Namespace: WebberZone\AutoClose\Features
Since: 3.0.0
Source: includes/features/class-close-date.php line 23

Methods

__construct()

Constructor.

Line: 81

public function __construct(  );

maybe_schedule_or_close()

Apply a post’s close dates now, leaving future dates to the sweep.

Line: 90

public function maybe_schedule_or_close( $post_id ): array;
Type Name Description
int $post_id Post ID.

Returns: array — Result data.

process_due_dates()

Close every date that is due, in bounded batches.

One recurring event serves every post, so the number of scheduled events does not grow with the number of close dates on the site.

Since: 3.2.0
Line: 143

public function process_due_dates(  ): array;

Returns: array — Sweep result.

get_sweep_recurrence() static

Recurrence used for the close-date sweep.

Since: 3.2.0
Line: 286

static public function get_sweep_recurrence(  ): string;

Returns: string — Registered recurrence name.

schedule_sweep() static

Register the recurring sweep, replacing it when the recurrence changes.

Since: 3.2.0
Line: 307

static public function schedule_sweep(  ): bool;

Returns: bool — Whether the sweep is registered.

maybe_migrate() static

Drop the per-post events used before 3.2.0 and register the sweep.

Since: 3.2.0
Line: 329

static public function maybe_migrate(  ): void;

Returns: void

maybe_close_due_comments_pings()

Cron callback for per-post events scheduled before 3.2.0.

Line: 368

public function maybe_close_due_comments_pings( $post_id, $type = ... ): void;
Type Name Description
int $post_id Post ID.
string $type Event type (‘comments’ or ‘pings’).

Returns: void