This comment has been minimized.
This comment has been minimized.
Thanks for this! |
This comment has been minimized.
This comment has been minimized.
You're welcome. Complete blog post here: https://www.kathyisawesome.com/add-custom-fields-to-wordpress-menu-items/ |
This comment has been minimized.
This comment has been minimized.
If I want to add custom fields to specific menus (not all menus), how do I do that? |
This comment has been minimized.
This comment has been minimized.
@photocurio the Menu itself does not seem to be passed anywhere as an argument to the My advice would be to leave the fields and just ignore them. |
This comment has been minimized.
This comment has been minimized.
@helgatheviking, its true the fields can be overlooked, but if you have a lot of menus, and some menus dedicated for specific purposes, and a lot of data, things can get messy. I'll post if I find a solution. |
This comment has been minimized.
This comment has been minimized.
@photocurio Fair. I'd try adding additional parameters, var dumping the new params and see what they are:
You might get lucky and have the menu location in the |
This comment has been minimized.
This comment has been minimized.
Neat example. Thank you! |
This comment has been minimized.
This is a really nice, minimal example for https://make.wordpress.org/core/2020/02/25/wordpress-5-4-introduces-new-hooks-to-add-custom-fields-to-menu-items/. Thanks for writing this up!