[wp-trac] [WordPress Trac] #39800: current_item_{parent|ancestor} Not set for Post Type Archive Items

WordPress Trac noreply at wordpress.org
Tue May 23 03:12:35 UTC 2017


#39800: current_item_{parent|ancestor} Not set for Post Type Archive Items
----------------------------------------+--------------------
 Reporter:  mrwweb                      |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.8
Component:  Menus                       |     Version:  4.7.2
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+--------------------
Changes (by welcher):

 * keywords:  has-patch => has-patch needs-unit-tests


Comment:

 @mrwweb thanks for pushing this along!

 Can you regenerate the patch from the root of the repo instead of `/src`?
 It applies fine but if we end up adding unit tests - spoiler alert: we
 should ;) - we'll need a second patch.

 The only other change I'd make is to change the `in_array` method to use
 the strict parameter to avoid unexpected results.

 i.e `in_array( $_anc_id, $active_ancestor_item_ids , true )`

 I might just be not getting it, but I was not able to get this setup
 locally to test it so I didn't make that change - can you share more
 detailed instructions?

 Either way, don't let me hold this up, it looks like others have tested it
 so if you make those changes we are probably good and should get some unit
 tests on this. The current tests all passed when I ran them.

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


More information about the wp-trac mailing list