[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 01:11:48 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):

 Tried re-writing my call to get_adjacent_posts to pass array of catagory
 IDs to exclude at same result of it not excluding when using v4.0.0 link-
 template.php and excludes properly with v3.9.2 link-template.php


 {{{
 function comtrya_get_next_post_float() {
         $post = get_adjacent_post(false, array(31,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>';
 }
 }}}

 Comparing the function get_adjacent_post() looks like it was extensively
 re-written in v4.0.0 so not easy to see why its not working now...atleast
 for me.

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


More information about the wp-trac mailing list