[wp-trac] [WordPress Trac] #63920: get_adjacent_post() has a misplaced check for WP_Error

WordPress Trac noreply at wordpress.org
Sat Sep 6 15:19:53 UTC 2025


#63920: get_adjacent_post() has a misplaced check for WP_Error
-------------------------------------------------+-------------------------
 Reporter:  kitchin                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.9
Component:  Posts, Post Types                    |     Version:  3.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  has-patch => has-patch needs-testing needs-unit-tests
 * version:  trunk => 3.7


Comment:

 This was introduced in one of those megalodon commits #26937/[27836], so
 not rare to see this. I wonder if PHPStan would have spotted it.

 Replying to [comment:1 westonruter]:
 > Also, it would be good to open a pull request with your patch so we can
 see the existing automated tests run.
 Tests are passing, but just because there are no unit tests covering this.
 It would be great to add them.

 Moreover, this can be a great opportunity to reunify all the hanging
 `get_adjacent_post` tests in other files that don't belong.

 Let me add the `needs-unit-tests` tag and if I find some time I will work
 on this @kitchin if you want to do it, send a PR as @westonruter
 commented.

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


More information about the wp-trac mailing list