функция
since 2.7.0
get_previous_posts_link()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_previous_posts_link( string $label = null ): string|null
Описание
Извлекает ссылку на страницу предыдущих записей.
Параметры
$label
string
необязательный
= null
Текст ссылки на предыдущую страницу.
Возвращаемое значение
string|null
Исходный код
wp-includes/link-template.php:2671
function get_previous_posts_link( $label = null ) {
global $paged;
if ( null === $label ) {
$label = __( '« Previous Page' );
}
if ( ! is_single() && $paged > 1 ) {
/**
* Filters the anchor tag attributes for the previous posts page link.
*
* @since 2.7.0
*
* @param string $attributes Attributes for the anchor tag.
*/
$attr = apply_filters( 'previous_posts_link_attributes', '' );
return sprintf(
'<a href="%1$s" %2$s>%3$s</a>',
previous_posts( false ),
$attr,
preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label )
);
}
}
История изменений
| Версия | Описание |
|---|---|
| 2.7.0 | Introduced. |

