You are here

function flag_form_submit in Flag 8.4

Same name and namespace in other branches
  1. 5 includes/flag.admin.inc \flag_form_submit()
  2. 6.2 includes/flag.admin.inc \flag_form_submit()
  3. 6 includes/flag.admin.inc \flag_form_submit()
  4. 7.3 includes/flag.admin.inc \flag_form_submit()
  5. 7.2 includes/flag.admin.inc \flag_form_submit()

Form submission handler for the flag module.

See also

flag_form_alter()

1 string reference to 'flag_form_submit'
flag_form_alter in ./flag.module
Implements hook_form_alter().

File

./flag.module, line 196
The Flag module.

Code

function flag_form_submit($form, FormStateInterface $form_state) {
  $entity = $form_state
    ->getFormObject()
    ->getEntity();
  if (!$form_state
    ->isValueEmpty('flag')) {
    $values = $form_state
      ->getValue('flag');
    flag_form_save($entity, $values);
  }
}