[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
Fri Mar 28 21:42:07 UTC 2014


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

 * keywords:  has-patch =>


Comment:

 Nacis is right. It does indeed split the query with external object cache
 so the patch is pretty useless. However, after a little more debugging it
 turned out that string replacement in alias_posts_table() breaks the
 `"$wpdb->posts.*" == $fields` assumption in WP_Query, thus explicitly
 setting $split_the_query to false :(

 To reproduce add the following before running a next post query with
 external object caching:

 {{{
 add_filter( 'get_next_post_where', function( $where ) { return $where; }
 );
 }}}

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


More information about the wp-trac mailing list