Create menu with custom fields
-
I am able to create a menu with the following code, except I am not able to populate my custom menu field by doing so:
$menuname = "flyout-menu"; wp_delete_nav_menu( $menuname ); $menu_id = wp_create_nav_menu( $menuname ); wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Home'), 'menu-item-type' => 'custom', 'menu-item-url' => home_url(), 'menu-item-custom' => 'A house is not a HOME.', 'menu-item-status' => 'publish'));
My ‘menu-item-custom’ is my custom field btw. Yet when I print_r the menu item the [custom] spot is empty, any ideas how to make this work?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Create menu with custom fields’ is closed to new replies.