ActionScheduler_OptionLock::get_expiration_from()privateWC 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 9.6.0

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

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

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

	return false;
}