WC_Data_Store_WP::string_to_timestamp()protectedWC 4.8.0

Converts a WP post date string into a timestamp.

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

Хуков нет.

Возвращает

int|null. The date string converted to a timestamp or null.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->string_to_timestamp( $time_string );
$time_string(строка) (обязательный)
The WP post date string.

Список изменений

С версии 4.8.0 Введена.

Код WC_Data_Store_WP::string_to_timestamp() WC 8.7.0

protected function string_to_timestamp( $time_string ) {
	return '0000-00-00 00:00:00' !== $time_string ? wc_string_to_timestamp( $time_string ) : null;
}