[wp-trac] [WordPress Trac] #29663: next_post_link & previous_post_link Category exclude broken

WordPress Trac noreply at wordpress.org
Wed Sep 24 14:27:35 UTC 2014


#29663: next_post_link & previous_post_link Category exclude broken
-------------------------------+-----------------------------
 Reporter:  gabrieldiggs       |       Owner:  wonderboymusic
     Type:  defect (bug)       |      Status:  assigned
 Priority:  normal             |   Milestone:  4.0.1
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  template
-------------------------------+-----------------------------
Changes (by posterworld):

 * version:  4.0 => trunk


Comment:

 hey guys, how are you?

 I'd been running some test and I found out this:

 On `link-template.php`, line `1514` is if change this line from WP 4.0
 file:

 {{{ $where .= " AND p.ID NOT IN ( SELECT object_id FROM
 $wpdb->term_relationships WHERE term_taxonomy_id IN (" . implode(
 $excluded_terms, ',' ) . ') )'; }}}

 to this one from WP 3.9.2 the exclude works great:

 {{{ $where = $wpdb->prepare( " AND tt.taxonomy = %s AND tt.term_id NOT IN
 (" . implode( $excluded_terms, ',' ) . ')', $taxonomy ); }}}

 I have no idea why but it works, I hope this could help you to find out
 what's happening with this.

 Regards!
 Pablo

 PD: Sorry for my lame English.

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


More information about the wp-trac mailing list