[wp-trac] [WordPress Trac] #26937: get_adjacent_post() should use WP_Query rather than build its own SQL query

WordPress Trac noreply at wordpress.org
Sat Jan 25 23:53:44 UTC 2014


#26937: get_adjacent_post() should use WP_Query rather than build its own SQL query
-------------------------+------------------------------
 Reporter:  ethitter     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Query        |     Version:  3.7
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------
Changes (by ethitter):

 * keywords:   => has-patch


Comment:

 [attachment:26937.2.patch] includes the following:

 * Rewrites `get_adjacent_post()` to leverage `WP_Query`.
 * Incorporates support for filters previously applied to
 `get_adjacent_post()`'s SQL clauses as discussed in the previous IRC
 conversation linked from this ticket. Supported filters are
 `get_previous_post_where`, `get_previous_post_join`,
 `get_previous_post_sort`, and their "next" counterparts.
 * Adds unit tests for the filter backwards compatibility. The conversion
 to `WP_Query` is covered by the existing tests from #17807.

 The included tests, plus those introduced as part of #17807, are passing
 at this time.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26937#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list