[wp-trac] [WordPress Trac] #29565: get_adjacent_post() not excluding category after upgrade (3.9.2 -> 4.0)

WordPress Trac noreply at wordpress.org
Wed Sep 10 02:23:06 UTC 2014


#29565: get_adjacent_post() not excluding category after upgrade (3.9.2 -> 4.0)
--------------------------+------------------------------
 Reporter:  toyNN         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by toyNN):

 I isolated the problem (atleast as I see it) to this new code (commented
 out) in the v4.0.0 get_adjacent_post() function. I replaced with the
 v3.9.2 code and the get_adjacent_post() correctly excludes the category
 ids (array),


 {{{
 if ( ! empty( $excluded_terms ) ) {
      /* $where .= " AND p.ID NOT IN ( SELECT object_id FROM
 $wpdb->term_relationships WHERE term_taxonomy_id IN (" . implode(
 $excluded_terms, ',' ) . ') )'; */
         $where = $wpdb->prepare( " AND tt.taxonomy = %s AND tt.term_id NOT
 IN (" . implode( $excluded_terms, ',' ) . ')', $taxonomy );
 }
 }}}

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


More information about the wp-trac mailing list