функция since 0.71

the_weekday_date()

Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.

Сигнатура

the_weekday_date( string $before = '', string $after = '' )

Описание

День недели выводится только в том случае, если день недели текущей записи отличается от предыдущего выведенного.

Оригинал (английский)

Will only output the weekday if the current post’s weekday is different from the previous one output.

Параметры

$before string необязательный = ''
Вывод перед датой.
$after string необязательный = ''
Вывод после даты.

Исходный код

wp-includes/general-template.php:3165

function the_weekday_date( $before = '', $after = '' ) {
	global $wp_locale, $currentday, $previousweekday;

	$post = get_post();

	if ( ! $post ) {
		return;
	}

	$the_weekday_date = '';

	if ( $currentday !== $previousweekday ) {
		$the_weekday_date .= $before;
		$the_weekday_date .= $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );
		$the_weekday_date .= $after;
		$previousweekday   = $currentday;
	}

	/**
	 * Filters the localized weekday of the post, for display.
	 *
	 * @since 0.71
	 *
	 * @param string $the_weekday_date The weekday on which the post was written.
	 * @param string $before           The HTML to output before the date.
	 * @param string $after            The HTML to output after the date.
	 */
	echo apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after );
}

История изменений

ВерсияОписание
0.71 Introduced.

Что будем искать? Например,Продвижение

Этот сайт использует куки-файлы. Оставаясь на сайте, Вы соглашаетесь на их использование. Для получения дополнительной информации, пожалуйста, ознакомьтесь с политикой в отношении персональных данных.