get_{$adjacent}_post_sort

get_{$adjacent}_post_sort

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('get_{$adjacent}_post_sort') is found 1 times:

  • /wp-includes/link-template.php line 2004
    	 * @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, $order );
    
    	$query        = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort";
    	$key          = md5( $query );
    	$last_changed = wp_cache_get_last_changed( 'posts' );
    	if ( $in_same_term || ! empty( $excluded_terms ) ) {
    		$last_changed .= wp_cache_get_last_changed( 'terms' );