Helper::get_adjacent_post( bool $in_same_term = false, int[]|string $excluded_terms = '', bool $previous = true, string $taxonomy = 'vimeo-videos' )
Retrieves the adjacent post.
Description
Can either be next or previous post.
Parameters
- $in_same_term
-
(Optional) Whether post should be in a same taxonomy term.
Default value: false
- $excluded_terms
-
(Optional) Array or comma-separated list of excluded term IDs.
Default value: ''
- $previous
-
(Optional) Whether to retrieve previous post. Default true
Default value: true
- $taxonomy
-
(Optional) Taxonomy, if $in_same_term is true. Default 'category'.
Default value: 'vimeo-videos'
Return
(\WP_Post|null|string) Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.
Source
File: includes/libs/templates/helper.class.php
public static function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'vimeo-videos' ){ $post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy ); return $post; }