# get_boundary_post_rel_link()

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

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

> Устаревший элемент. Помечен устаревшим с версии 3.3.0.

## Сигнатура

```php
get_boundary_post_rel_link( string $title = '%title', bool $in_same_cat = false, string $excluded_categories = '', bool $start = true ): string
```

## Описание

Может быть реляционной ссылкой на первую или последнюю запись.

## Параметры

- `$title` `string` — необязательный, по умолчанию `'%title'`. Формат заголовка ссылки. По умолчанию '%title'.
- `$in_same_cat` `bool` — необязательный, по умолчанию `false`. Должна ли ссылка вести на запись из той же категории.
- `$excluded_categories` `string` — необязательный, по умолчанию `''`. ID исключаемых категорий.
- `$start` `bool` — необязательный, по умолчанию `true`. Отображать ли ссылку на первую или последнюю запись.

## Возвращаемое значение

`string`

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

Файл: `wp-includes/deprecated.php:2690`

```php
function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {
	_deprecated_function( __FUNCTION__, '3.3.0' );

	$posts = get_boundary_post($in_same_cat, $excluded_categories, $start);
	// If there is no post, stop.
	if ( empty($posts) )
		return;

	// Even though we limited get_posts() to return only 1 item it still returns an array of objects.
	$post = $posts[0];

	if ( empty($post->post_title) )
		$post->post_title = $start ? __('First Post') : __('Last Post');

	$date = mysql2date(get_option('date_format'), $post->post_date);

	$title = str_replace('%title', $post->post_title, $title);
	$title = str_replace('%date', $date, $title);
	/** This filter is documented in wp-includes/post-template.php */
	$title = apply_filters('the_title', $title, $post->ID);

	$link = $start ? "<link rel='start' title='" : "<link rel='end' title='";
	$link .= esc_attr($title);
	$link .= "' href='" . get_permalink($post) . "' />\n";

	$boundary = $start ? 'start' : 'end';
	return apply_filters( "{$boundary}_post_rel_link", $link );
}
```

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

- 3.3.0 — Устаревший.
- 2.8.0 — Introduced.

## Связанные

Использует: [`mysql2date`](https://chugunov.pro/api-wordpress/functions/mysql2date/), [`get_boundary_post`](https://chugunov.pro/api-wordpress/functions/get_boundary_post/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`esc_attr`](https://chugunov.pro/api-wordpress/functions/esc_attr/), [`_deprecated_function`](https://chugunov.pro/api-wordpress/functions/_deprecated_function/), [`get_permalink`](https://chugunov.pro/api-wordpress/functions/get_permalink/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/), [`get_option`](https://chugunov.pro/api-wordpress/functions/get_option/).
Используется в: [`start_post_rel_link`](https://chugunov.pro/api-wordpress/functions/start_post_rel_link/).

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