mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Posts, Post Types: Pass the order
parameter to get_{$adjacent}_post_sort
filter.
Props manchumahara. Fixes #41924. Built from https://develop.svn.wordpress.org/trunk@41589 git-svn-id: http://core.svn.wordpress.org/trunk@41422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4a42f4e835
commit
4865841343
@ -1723,11 +1723,13 @@ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @since 4.4.0 Added the `$post` parameter.
|
||||
* @since 4.9.0 Added the `$order` parameter.
|
||||
*
|
||||
* @param string $order_by The `ORDER BY` clause in the SQL.
|
||||
* @param WP_Post $post WP_Post object.
|
||||
* @param string $order Sort order. 'DESC' for previous post, 'ASC' for next.
|
||||
*/
|
||||
$sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post );
|
||||
$sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post, $order );
|
||||
|
||||
$query = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort";
|
||||
$query_key = 'adjacent_post_' . md5( $query );
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9-alpha-41588';
|
||||
$wp_version = '4.9-alpha-41589';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user