WordPress at Your Fingertips
function is not described

ActionScheduler_wcSystemStatus::get_oldest_and_newest() protected WC 1.0

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

{} It's a 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.

Code of ActionScheduler_wcSystemStatus::get_oldest_and_newest() WC 6.1.1

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;
}