функция Устаревший since 0.71

next_post()

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

Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.

Сигнатура

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

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.

Что будем искать? Например,Продвижение

Этот сайт использует куки-файлы. Оставаясь на сайте, Вы соглашаетесь на их использование. Для получения дополнительной информации, пожалуйста, ознакомьтесь с политикой в отношении персональных данных.