ActionScheduler_wcSystemStatus::get_oldest_and_newest()protectedWC 1.0

Get oldest and newest scheduled dates for a given set of statuses.

Method of the class: ActionScheduler_wcSystemStatus{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_oldest_and_newest( $status_keys );
$status_keys(array) (required)
Set of statuses to find oldest & newest action for.

ActionScheduler_wcSystemStatus::get_oldest_and_newest() code WC 8.7.0

protected function get_oldest_and_newest( $status_keys ) {

	$oldest_and_newest = array();

	foreach ( $status_keys as $status ) {
		$oldest_and_newest[ $status ] = array(
			'oldest' => '–',
			'newest' => '–',
		);

		if ( 'in-progress' === $status ) {
			continue;
		}

		$oldest_and_newest[ $status ]['oldest'] = $this->get_action_status_date( $status, 'oldest' );
		$oldest_and_newest[ $status ]['newest'] = $this->get_action_status_date( $status, 'newest' );
	}

	return $oldest_and_newest;
}