# the_weekday_date()

URL: https://chugunov.pro/api-wordpress/functions/the_weekday_date/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 0.71.

## Сигнатура

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

## Описание

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

## Параметры

- `$before` `string` — необязательный, по умолчанию `''`. Вывод перед датой.
- `$after` `string` — необязательный, по умолчанию `''`. Вывод после даты.

## Исходный код

Файл: `wp-includes/general-template.php:3165`

```php
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.

## Связанные

Использует: [`get_post_time`](https://chugunov.pro/api-wordpress/functions/get_post_time/), `WP_Locale::get_weekday`, [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/), [`get_post`](https://chugunov.pro/api-wordpress/functions/get_post/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/the_weekday_date/
