List Last Changes
Отображение списка последних изменений в области виджетов, через шорткод или в редакторе блоков Gutenberg. Он может включать изменённые страницы и/или записи (настраивается).
Дополнительные возможности:
- Укажите количество элементов в списке
- Определить страницы для исключения
- Show the author or the last editor of the page/post
- Select and order by date modified or date published
Исключение страницы или записи
Чтобы исключить страницу или запись из списка в виджете, выполните следующие действия:
- Откройте редактирование страницы или записи, которую вы хотите исключить.
- Откройте «Настройки экрана» (в правом верхнем углу страницы)
- Убедитесь, что «Пользовательские поля» отмечены (см. скриншот № 3)
- In the «Custom Fields» further down the screen add the following custom field (see Screenshot #4):
- name: list_last_changes_ignore
- значение: true
Чтобы отменить исключение, установите значение false или полностью удалите пользовательское поле.
Редактор блоков (Gutenberg)
Блок находится в разделе Виджеты -> List Last Changes. Блок можно изменять в настройках блока (панель справа).
В отличие от виджета, заголовок в блоке не пишется. Если необходим заголовок, он должен быть указан в блоке перед List Last Changes.
Шорткод
Чтобы показывать список последних изменений с помощью шорткода, используйте следующий синтаксис:
[list_last_changes number='7' showpages='true' showposts='true' showauthor='false' usedatepublished='true' template='{title} {change_date} {author}' /]
The attribute ‘number’ defines the number of entries shown. With the attributes ‘showpages’ and ‘showposts’ changed pages and/or posts are included. To show also the author set the attribute ‘showauthor’ to true (deprecated, use template mechanism instead). With the attribute ‘usedatepublished’ set to ‘true’ the date when the page or post was first published, if set to ‘false’ (or not set at all) the date the page or post was modified is used. The ‘template’ attribute defines the content of the entries. If the ‘template’ attribute is defined the attribute ‘showauthor’ is ignored.
В отличие от виджета, с шорткодом заголовок не пишется. Если требуется заголовок, его нужно указать вручную перед шорткодом.
Шаблоны
In the template string the following fields can be used: {title}, {change_date}, {published_date}, {author} and {editor}. {title} : the title of the page or post with a link to it {change_date} or {change_date[format]} : the date the page or post was changed («modified date») {published_date} or {published_date[format]} : the date the page or post was published («post date») {author} : the author of the page or post {editor} : the last editor of the page or post
With the optional [format] the date format of change_date and published_date can be defined. The date format is in the php date formatting. Without definition the wordpress system date format is used.
Sample templates: {title} {change_date} : the default template {title} {change_date[Y-m-d H:i]} : like the default template but with date and time defined by the given format {title} {change_date} {author} : behaves as in versions before 0.9 when show author was enabled {change_date} : shows only the change_date, can be used with number = 1 as last modified date of a WordPress Site