• davida77

    (@davida77)


    I am trying to add custom fields to the menu items. I have found examples on using the following hook:

    wp_nav_menu_item_custom_fields

    For example on this site: https://pressidium.com/blog/adding-custom-fields-to-wordpress-menu-items/

    As well as on the official WordPress release blog it is stated that it is as simple as doing something like this in the functions.php file to make something appear:

    function my_menu_item_field() {
            echo 'A menu item test field';
        }
        add_action( 'wp_nav_menu_item_custom_fields', 'my_menu_item_field' );

    I have tried all sorts of examples but nothing appears at all. I am using WordPress 6.3.2 where the menu section is in the customizer menu.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom fields menu items’ is closed to new replies.