Action_Scheduler\WP_CLI
System_Command::get_oldest_and_newest
Get oldest and newest scheduled dates for a given set of statuses.
Метод класса: System_Command{}
Хуков нет.
Возвращает
Массив
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_oldest_and_newest( $status_keys );
- $status_keys(массив) (обязательный)
- Set of statuses to find oldest & newest action for.
Код System_Command::get_oldest_and_newest() System Command::get oldest and newest WC 10.0.2
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; }