WPSEO_Replace_Vars::retrieve_currenttime()privateYoast 1.0

Retrieve the current time for use as replacement string.

The $replacement variable is static because it doesn't change depending on the context. See https://github.com/Yoast/wordpress-seo/pull/1172#issuecomment-46019482.

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

Хуков нет.

Возвращает

Строку. The formatted current time.

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

// private - только в коде основоного (родительского) класса
$result = $this->retrieve_currenttime();

Код WPSEO_Replace_Vars::retrieve_currenttime() Yoast 22.4

private function retrieve_currenttime() {
	static $replacement;

	if ( ! isset( $replacement ) ) {
		$replacement = date_i18n( get_option( 'time_format' ) );
	}

	return $replacement;
}