ActionScheduler_OptionLock::get_expiration_from │ private │ WC 1.0

Given the lock string, derives the lock expiration timestamp (or false if it cannot be determined).

Метод класса: ActionScheduler_OptionLock{}

Хуков нет.

Возвращает

false|int.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_expiration_from( $lock_value );
$lock_value(строка) (обязательный)
String containing a timestamp, or pipe-separated combination of unique value and timestamp.

Код ActionScheduler_OptionLock::get_expiration_from() WC 11.2.2

private function get_expiration_from( $lock_value ) {
	$lock_string = explode( '|', $lock_value );
	$count       = count( $lock_string );

	// Old style lock?
	if ( 1 === $count && is_numeric( $lock_string[0] ) ) {
		return (int) $lock_string[0];
	}

	// New style lock?
	if ( 2 === $count && is_numeric( $lock_string[1] ) ) {
		return (int) $lock_string[1];
	}

	return false;
}