apply_filters( "get_{$adjacent}_post_join", string $join, bool $in_same_term, int[]|string $excluded_terms, string $taxonomy, WP_Post $post )
- Since
- 2.5.0, 4.4.0
Filters the JOIN clause in the SQL for an adjacent post query.
Description
The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, 'next' or 'previous'.
Possible hook names include:
get_next_post_joinget_previous_post_join
Compatibility
- WordPress
- since 4.4.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$joinstring- The JOIN clause in the SQL.
$in_same_termbool- Whether post should be in the same taxonomy term.
$excluded_termsint[]|string- Array of excluded term IDs. Empty string if none were provided.
$taxonomystring- Taxonomy. Used to identify the term used when
$in_same_termis true. $postWP_Post- WP_Post object.
Where this hook fires · 1
wp-includes/link-template.php:1961get_adjacent_post()
Source code
* @param string $join The JOIN clause in the SQL. * @param bool $in_same_term Whether post should be in the same taxonomy term. * @param int[]|string $excluded_terms Array of excluded term IDs. Empty string if none were provided. * @param string $taxonomy Taxonomy. Used to identify the term used when `$in_same_term` is true. * @param WP_Post $post WP_Post object. */ $join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms, $taxonomy, $post ); /** * Filters the WHERE clause in the SQL for an adjacent post query. * * The dynamic portion of the hook name, `$adjacent`, refers to the type * of adjacency, 'next' or 'previous'.Changelog
Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.4.0
Added the
$taxonomy and $post parameters.from the docblock2.5.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, 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.