mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-23 07:51:49 +01:00
Pass taxonomy name to filters in get_adjacent_post()
.
Props sboisvert. Fixes #33568. Built from https://develop.svn.wordpress.org/trunk@33805 git-svn-id: http://core.svn.wordpress.org/trunk@33773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7f5a8e6680
commit
a0e00c0d24
@ -1570,12 +1570,14 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo
|
|||||||
* of adjacency, 'next' or 'previous'.
|
* of adjacency, 'next' or 'previous'.
|
||||||
*
|
*
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
|
* @since 4.4.0 Added the `$taxonomy` parameter.
|
||||||
*
|
*
|
||||||
* @param string $join The JOIN clause in the SQL.
|
* @param string $join The JOIN clause in the SQL.
|
||||||
* @param bool $in_same_term Whether post should be in a same taxonomy term.
|
* @param bool $in_same_term Whether post should be in a same taxonomy term.
|
||||||
* @param array $excluded_terms Array of excluded term IDs.
|
* @param array $excluded_terms Array of excluded term IDs.
|
||||||
|
* @param string $taxonomy Taxonomy. Used to identify the term used when `$in_same_term` is true.
|
||||||
*/
|
*/
|
||||||
$join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms );
|
$join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms, $taxonomy );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the WHERE clause in the SQL for an adjacent post query.
|
* Filter the WHERE clause in the SQL for an adjacent post query.
|
||||||
@ -1584,12 +1586,14 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo
|
|||||||
* of adjacency, 'next' or 'previous'.
|
* of adjacency, 'next' or 'previous'.
|
||||||
*
|
*
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
|
* @since 4.4.0 Added the `$taxonomy` parameter.
|
||||||
*
|
*
|
||||||
* @param string $where The `WHERE` clause in the SQL.
|
* @param string $where The `WHERE` clause in the SQL.
|
||||||
* @param bool $in_same_term Whether post should be in a same taxonomy term.
|
* @param bool $in_same_term Whether post should be in a same taxonomy term.
|
||||||
* @param array $excluded_terms Array of excluded term IDs.
|
* @param array $excluded_terms Array of excluded term IDs.
|
||||||
|
* @param string $taxonomy Taxonomy. Used to identify the term used when `$in_same_term` is true.
|
||||||
*/
|
*/
|
||||||
$where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms );
|
$where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms, $taxonomy );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the ORDER BY clause in the SQL for an adjacent post query.
|
* Filter the ORDER BY clause in the SQL for an adjacent post query.
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-33804';
|
$wp_version = '4.4-alpha-33805';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user