[wp-trac] [WordPress Trac] #49500: WordPress 5.4 messes up custom fields added to menu items they are duplicated.

WordPress Trac noreply at wordpress.org
Mon Feb 24 14:19:37 UTC 2020


#49500: WordPress 5.4 messes up custom fields added to menu items they are
duplicated.
--------------------------+------------------------------
 Reporter:  BackuPs       |       Owner:  audrasjb
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by BackuPs):

 Hi

 Its because a new action call has been added in wp 5.4. There is no way to
 check if it has been called already.  Before wp 5.4 we had to call it
 ourselves as the action call in default wp is not there.


 https://cl.ly/8653ce8bab3c


 {{{#!php
 <?php

                                 <?php
                                 /**
                                  * Fires just before the move buttons of a
 nav menu item in the menu editor.
                                  *
                                  * @since 5.4.0
                                  *
                                  * @param int      $item_id Menu item ID.
                                  * @param WP_Post  $item    Menu item data
 object.
                                  * @param int      $depth   Depth of menu
 item. Used for padding.
                                  * @param stdClass $args    An object of
 menu item arguments.
                                  * @param int      $id      Nav menu ID.
                                  */
                                 do_action(
 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args, $id );
                                 ?>
 }}}

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


More information about the wp-trac mailing list