функция
since 2.1.0
the_modified_date()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
the_modified_date( string $format = '', string $before = '', string $after = '', bool $display = true ): string|null
Описание
Выводит дату последнего изменения записи.
Параметры
$format
string
необязательный
= ''
Формат даты PHP. По умолчанию используется опция 'date_format'.
$before
string
необязательный
= ''
Вывод перед датой.
$after
string
необязательный
= ''
Вывод после даты.
$display
bool
необязательный
= true
Выводить дату или возвращать её.
Возвращаемое значение
string|null
Исходный код
wp-includes/general-template.php:2761
function the_modified_date( $format = '', $before = '', $after = '', $display = true ) {
$the_modified_date = $before . get_the_modified_date( $format ) . $after;
/**
* Filters the date a post was last modified, for display.
*
* @since 2.1.0
*
* @param string $the_modified_date The last modified date.
* @param string $format PHP date format.
* @param string $before HTML output before the date.
* @param string $after HTML output after the date.
*/
$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );
if ( $display ) {
echo $the_modified_date;
} else {
return $the_modified_date;
}
}
История изменений
| Версия | Описание |
|---|---|
| 2.1.0 | Introduced. |

