[wp-trac] [WordPress Trac] #53214: Register Menu Item Custom Field

WordPress Trac noreply at wordpress.org
Fri Jul 19 15:58:55 UTC 2024


#53214: Register Menu Item Custom Field
--------------------------+------------------------------
 Reporter:  mortezayung   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Menus         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+------------------------------
Changes (by sabernhardt):

 * keywords:   => close


Comment:

 Hi!

 I think this belonged on the support forums.
 https://wordpress.org/support/forum/how-to-and-troubleshooting/

 If you use the PHP hook to add a custom field at a certain depth, you
 would need to save changes to show or hide that field.

 If you can add the custom field to all items, you could hide it at deeper
 levels with admin CSS:
 {{{
 #menu-to-edit .menu-item:not(.menu-item-depth-0) .my-custom-field {
         display: none;
 }
 }}}

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


More information about the wp-trac mailing list