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

WordPress Trac noreply at wordpress.org
Sat Sep 6 22:26:59 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        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Code works fine in 3.9.2 but category (posts) not excluded after upgrade
 to 4.0

 {{{
 $post = get_adjacent_post(false, '410', false);
 }}}

 or

 {{{
 $post = get_adjacent_post(false, '31 and 32 and 410', false);
 }}}

 I've overwritten only the v4.0 "link-template.php" with the file from
 v3.9.2 and properly exclude the post category(s) again.

 Full custom function I've been using,

 {{{
 function comtrya_get_next_post_float() {
         $post = get_adjacent_post(false, '410', false);
         if (!$post) return;
         $thumb_nav =
 wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'facebook');
         echo '<a href="'.get_permalink($post).'" rel="next" class="older"
 title="'.get_the_title($post).'">';
         echo
 '<p>'.htmlspecialchars(substr_replace(html_entity_decode(htmlspecialchars_decode(get_the_title($post)),0,'UTF-8'),'..',27,1000)).'</p>';
         echo '<img height="80" width="80" class="nav-thumbnail"
 src="'.$thumb_nav[0].'">';
         echo '<span class="cfb_next"></span>';
         echo '</a>';
 }
 }}}

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


More information about the wp-trac mailing list