[wp-trac] [WordPress Trac] #39925: Using unset to remove menu items, unset's other than those to be unset

WordPress Trac noreply at wordpress.org
Tue Jun 13 03:15:31 UTC 2017


#39925: Using unset to remove menu items, unset's other than those to be unset
---------------------------+----------------------
 Reporter:  patriknilsson  |       Owner:
     Type:  defect (bug)   |      Status:  closed
 Priority:  normal         |   Milestone:
Component:  Menus          |     Version:  4.7.2
 Severity:  normal         |  Resolution:  invalid
 Keywords:  close          |     Focuses:  ui
---------------------------+----------------------
Changes (by welcher):

 * keywords:   => close
 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 @patriknilsson thanks for the report and welcome to Core!

 I was unable to reproduce the error using the code provided. I was able to
 remove menu items using unset without issue using the following:
 {{{
 add_filter( 'wp_get_nav_menu_items','nav_items', 10, 3 );
 function nav_items( $items, $menu, $args ) {
     unset( $items[1] );
     return $items;
 }
 }}}

 Unless this can reproduce using TwentySeventeen this may be better suited
 for an Avada or WordPress support forum.

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


More information about the wp-trac mailing list