wppaste
WordPress

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

Since
0.71
Source
wp-includes/deprecated.php:173
Prints link to the next post.

Parameters

$formatstringoptional
Default: '%'
$nextstringoptional
Default: 'next post: '
$titlestringoptional
Default: 'yes'
$in_same_catstringoptional
Default: 'no'
$limitnextintoptional
Default: 1
$excluded_categoriesstringoptional
Default: ''

Hooks fired · 1

One hook fires while next_post() runs, in this order:

  1. apply_filters( the_title )filterline 188 (+15 into the body)

    Filters the post title.

Uses · 4

Source

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 )		$string .= apply_filters('the_title', $post->post_title, $post->ID);	$string .= '</a>';	$format = str_replace('%', $string, $format);	echo $format;}

History

Introduced in 0.71. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

2.0.0
Deprecated. Use next_post_link()from the docblock
0.71
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-includes/deprecated.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.