get_next_post

Definition:
function get_next_post($in_same_cat = false, $excluded_categories = '') {}

Retrieve next post that is adjacent to current post.

Parameters

  • bool $in_same_cat: Optional. Whether post should be in a same category.
  • array|string $excluded_categories: Optional. Array or comma-separated list of excluded category IDs.

Return values

returns:Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.

Source code

function get_next_post($in_same_cat = false, $excluded_categories = '') {

	return get_adjacent_post($in_same_cat, $excluded_categories, false);

}

1498

No comments yet... Be the first to leave a reply!

Leave a comment