WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

ActionScheduler_QueueCleaner::delete_old_actions() public WC 1.0

Это метод класса: ActionScheduler_QueueCleaner{}

Возвращает

Null. Ничего.

Использование

$ActionScheduler_QueueCleaner = new ActionScheduler_QueueCleaner();
$ActionScheduler_QueueCleaner->delete_old_actions();

Код ActionScheduler_QueueCleaner::delete_old_actions() WC 4.5.2

woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueCleaner.php
<?php
public function delete_old_actions() {
	$lifespan = apply_filters( 'action_scheduler_retention_period', $this->month_in_seconds );
	$cutoff = as_get_datetime_object($lifespan.' seconds ago');

	$statuses_to_purge = array(
		ActionScheduler_Store::STATUS_COMPLETE,
		ActionScheduler_Store::STATUS_CANCELED,
	);

	foreach ( $statuses_to_purge as $status ) {
		$actions_to_delete = $this->store->query_actions( array(
			'status'           => $status,
			'modified'         => $cutoff,
			'modified_compare' => '<=',
			'per_page'         => $this->get_batch_size(),
		) );

		foreach ( $actions_to_delete as $action_id ) {
			try {
				$this->store->delete_action( $action_id );
			} catch ( Exception $e ) {

				/**
				 * Notify 3rd party code of exceptions when deleting a completed action older than the retention period
				 *
				 * This hook provides a way for 3rd party code to log or otherwise handle exceptions relating to their
				 * actions.
				 *
				 * @since 2.0.0
				 *
				 * @param int $action_id The scheduled actions ID in the data store
				 * @param Exception $e The exception thrown when attempting to delete the action from the data store
				 * @param int $lifespan The retention period, in seconds, for old actions
				 * @param int $count_of_actions_to_delete The number of old actions being deleted in this batch
				 */
				do_action( 'action_scheduler_failed_old_action_deletion', $action_id, $e, $lifespan, count( $actions_to_delete ) );
			}
		}
	}
}