[wp-trac] [WordPress Trac] #57169: Prevent saving of invalid menu_item_parent

WordPress Trac noreply at wordpress.org
Fri Jan 6 10:50:39 UTC 2023


#57169: Prevent saving of invalid menu_item_parent
--------------------------+-----------------------
 Reporter:  azaozz        |       Owner:  azaozz
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  6.1.2
Component:  Menus         |     Version:  6.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------

Comment (by manooweb):

 @azaozz Yes! You understood correctly how our language switcher works. As
 @Chouby explained we create menu item dynamically from the first menu item
 (first language) and make their ID unique (used in HTML side) by suffixing
 the language code to the intitial ID. Their parent menu item id is
 obviously set to the id from the initial menu item. It allows us to really
 create a submenu then.

 Your fix works however, IMHO, I wonder if just remove int casting isn't
 sufficient.

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


More information about the wp-trac mailing list