# next_post()

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

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

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

## Сигнатура

```php
next_post( string $format = '%', string $next = 'next post: ', string $title = 'yes', string $in_same_cat = 'no', int $limitnext = 1, string $excluded_categories = '' )
```

## Описание

См. alsonext_post_link()

## Параметры

- `$format` `string` — необязательный, по умолчанию `'%'`. Default:'%'
- `$next` `string` — необязательный, по умолчанию `'next post: '`. Default:'next post: '
- `$title` `string` — необязательный, по умолчанию `'yes'`. Default:'yes'
- `$in_same_cat` `string` — необязательный, по умолчанию `'no'`. Default:'no'
- `$limitnext` `int` — необязательный, по умолчанию `1`. Default:1
- `$excluded_categories` `string` — необязательный, по умолчанию `''`. Default:''

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

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

```php
function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
	_deprecated_function( __FUNCTION__, '2.0.0', 'next_post_link()' );

	if ( empty($in_same_cat) || 'no' == $in_same_cat )
		$in_same_cat = false;
	else
		$in_same_cat = true;

	$post = get_next_post($in_same_cat, $excluded_categories);

	if ( !$post	)
		return;

	$string = '<a href="'.get_permalink($post->ID).'">'.$next;
	if ( 'yes' == $title )
		/** This filter is documented in wp-includes/post-template.php */
		$string .= apply_filters('the_title', $post->post_title, $post->ID);
	$string .= '</a>';
	$format = str_replace('%', $string, $format);
	echo $format;
}
```

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

- 2.0.0 — Deprecated. Use next_post_link()
- 0.71 — Introduced.

## Связанные

Использует: [`get_next_post`](https://chugunov.pro/api-wordpress/functions/get_next_post/), [`_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/).

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