Definition:
function get_previous_post($in_same_cat = false, $excluded_categories = '') {}
Retrieve previous 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_previous_post($in_same_cat = false, $excluded_categories = '') { return get_adjacent_post($in_same_cat, $excluded_categories); }
1641
No comments yet... Be the first to leave a reply!