Skip to main content

My suggestion is to use hook_form_alterhook_form_FORM_ID_alter to add a custom submit handler. In that submit handler, you will get the current menu item values. Use those values to create a new menu item for the other menu.

Functions to use:

  1. hook_form_FORM_ID_alter. Here form id will be 'menu_edit_item'
  2. Use form['#submit'][] = "custom submit handler" in form alter.
  3. Use menu_link_save in custom submit handler based on the values you get form the form_state.

My suggestion is to use hook_form_alter to add a custom submit handler. In that submit handler, you will get the current menu item values. Use those values to create a new menu item for the other menu.

Functions to use:

  1. hook_form_FORM_ID_alter. Here form id will be 'menu_edit_item'
  2. Use form['#submit'][] = "custom submit handler" in form alter.
  3. Use menu_link_save in custom submit handler based on the values you get form the form_state.

My suggestion is to use hook_form_FORM_ID_alter to add a custom submit handler. In that submit handler, you will get the current menu item values. Use those values to create a new menu item for the other menu.

Functions to use:

  1. hook_form_FORM_ID_alter. Here form id will be 'menu_edit_item'
  2. Use form['#submit'][] = "custom submit handler" in form alter.
  3. Use menu_link_save in custom submit handler based on the values you get form the form_state.

My suggestion is to use hooK_form_FORM_ID_alterhook_form_alter to add a custom submit handler. In that submit handler, you will get the current menu item values. Use those values to create a new menu item for the other menu.

Functions to use:

  1. hook_form_FORM_ID_alter. Here form id will be 'menu_edit_item'
  2. Use form['#submit'][] = "custom submit handler" in form alter.
  3. Use menu_link_save in custom submit handler based on the values you get form the form_state.

My suggestion is to use hooK_form_FORM_ID_alter to add a custom submit handler. In that submit handler, you will get the current menu item values. Use those values to create a new menu item for the other menu.

Functions to use:

  1. hook_form_FORM_ID_alter. Here form id will be 'menu_edit_item'
  2. Use form['#submit'][] = "custom submit handler" in form alter.
  3. Use menu_link_save in custom submit handler based on the values you get form the form_state.

My suggestion is to use hook_form_alter to add a custom submit handler. In that submit handler, you will get the current menu item values. Use those values to create a new menu item for the other menu.

Functions to use:

  1. hook_form_FORM_ID_alter. Here form id will be 'menu_edit_item'
  2. Use form['#submit'][] = "custom submit handler" in form alter.
  3. Use menu_link_save in custom submit handler based on the values you get form the form_state.
Source Link
Manikandan
  • 720
  • 4
  • 18

My suggestion is to use hooK_form_FORM_ID_alter to add a custom submit handler. In that submit handler, you will get the current menu item values. Use those values to create a new menu item for the other menu.

Functions to use:

  1. hook_form_FORM_ID_alter. Here form id will be 'menu_edit_item'
  2. Use form['#submit'][] = "custom submit handler" in form alter.
  3. Use menu_link_save in custom submit handler based on the values you get form the form_state.