function menu_token_custom_entity_callback in Menu Token 8
Same name and namespace in other branches
- 9.1.x menu_token.module \menu_token_custom_entity_callback()
Ajax callback for the method select dropdown.
1 string reference to 'menu_token_custom_entity_callback'
- menu_token_form_menu_link_content_form_alter in ./
menu_token.module - Implements hook_form_FORM_ID_alter().
File
- ./
menu_token.module, line 209 - Contains menu_token.module.
Code
function menu_token_custom_entity_callback($form, &$form_state) {
$triggering_element = $form_state
->getTriggeringElement();
if ($triggering_element['#value'] == 'user_defined') {
$element = $triggering_element['#array_parents'][1];
}
else {
// Return just the wrapper. Form was rebuild in the background.
$element = $triggering_element['#array_parents'][1];
}
return $form['menu_token_options'][$element]['custom_entity_wrapper'];
}