Answers for "drupal 7 hook_form_alter"

PHP
0

drupal 7 hook_form_alter

function hook_form_alter(&$form, &$form_state, $form_id) {
  if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) {
    $form['workflow']['upload_' . $form['type']['#value']] = array(
      '#type' => 'radios',
      '#title' => t('Attachments'),
      '#default_value' => variable_get('upload_' . $form['type']['#value'], 1),
      '#options' => array(
        t('Disabled'),
        t('Enabled'),
      ),
    );
  }
}
Posted by: Guest on July-12-2021

Code answers related to "drupal 7 hook_form_alter"

Browse Popular Code Answers by Language