Get $form_state backup and migrate filter extended class I have form altered the backup and migrate quick backup screen (admin/config/system/backup_migrate) and added a text field. I'd like to use the value of the field to create a new node just before the backup is done. I found a way to "hook" backup and migrate just before it performs a backup, which is great. However, I need to get $form_state['values']['my_value'] and pass that to my function that creates a new node. I can't figure out how to get that passed to the pre_backup() inside the extended class backup_migrate_filter.
From your question, I get you altered the form built from the following function.

/**
 * The quick backup form.
 */
function backup_migrate_ui_manual_quick_backup_form($form, &amp;$form_state, $inline = TRUE) {
  backup_migrate_include('profiles', 'destinations', 'sources');
  drupal_add_js(drupal_get_path('module', 'backup_migrate') .'/backup_migrate.js');

  $form = array();

  // Theme the form if we want it inline.
  if ($inline) {
    $form['#theme'] = 'backup_migrate_ui_manual_quick_backup_form_inline';
  }

  $form['quickbackup'] = array(
    '#type' =&gt; 'fieldset',
    "#title" =&gt; t("Quick Backup"),
    "#collapsible" =&gt; FALSE,
    "#collapsed" =&gt; FALSE,
    "#tree" =&gt; FALSE,
  );

  $form['quickbackup']['source_id'] = _backup_migrate_get_source_pulldown(variable_get('backup_migrate_source_id', NULL));

  $form['quickbackup']['destination'] = _backup_migrate_get_destination_pulldown('manual backup', variable_get('backup_migrate_destination_id', 'download'), variable_get('backup_migrate_copy_destination_id', ''));

  $profile_options = _backup_migrate_get_profile_form_item_options();
  $form['quickbackup']['profile_id'] = array(
    "#type" =&gt; "select",
    "#title" =&gt; t("Settings Profile"),
    '#default_value' =&gt; variable_get('backup_migrate_profile_id', NULL),
    "#options" =&gt; $profile_options,
  );

  $form['quickbackup']['description_enabled'] = array(
    '#type' =&gt; 'checkbox',
    "#title" =&gt; t("Add a note to the backup"),
  );
  $form['quickbackup']['description'] = array(
    '#type' =&gt; 'backup_migrate_dependent',
    '#dependencies' =&gt; array(
      'description_enabled' =&gt; TRUE,
    ),
  );

  $form['quickbackup']['description']['description'] = array(
    '#type' =&gt; 'textarea',
    "#title" =&gt; t("Note"),
    '#description' =&gt; t('This note will be saved with the backup file and shown on the listing page.'),
  );

  $form['advanced'] = array(
    '#type' =&gt; 'markup',
    '#markup' =&gt; '&lt;div class="clearblock backup-migrate-footer-message"&gt;' . t('For more backup options, try the &lt;a href="!advancedurl"&gt;advanced backup page&lt;/a&gt;.', array('!advancedurl' =&gt; url(BACKUP_MIGRATE_MENU_PATH . '/export/advanced'))) . '&lt;/div&gt;',
  );

  $form['quickbackup']['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Backup now'),
    '#weight' =&gt; 1,
  );

  $form['#validate'] = array('backup_migrate_ui_manual_quick_backup_form_validate');
  $form['#submit'] = array('backup_migrate_ui_manual_quick_backup_form_submit');

  return _backup_migrate_ui_action_form($form, $form_state, 'backup');
}


The only way to pass a value submitted in a form to a hook is to save it into a persistent variable, exactly in the same way a submission handler does.

/**
 * Submit the quick backup form.
 */
function backup_migrate_ui_manual_quick_backup_form_submit($form, &amp;$form_state) {
  backup_migrate_include('profiles', 'destinations');
  if (user_access('perform backup') &amp;&amp; !empty($form_state['values']['settings'])) {
    // Save the settings for next time.
    variable_set("backup_migrate_source_id", $form_state['values']['source_id']);
    variable_set("backup_migrate_destination_id", $form_state['values']['destination_id']);
    variable_set("backup_migrate_copy_destination_id", $form_state['values']['copy_destination_id']);
    variable_set("backup_migrate_profile_id", $form_state['values']['profile_id']);

    // Do the backup.
    backup_migrate_ui_manual_backup_perform($form_state['values']['settings']);
  }
  $form_state['redirect'] = BACKUP_MIGRATE_MENU_PATH;
}


Your hook_form_alter() implementation needs to do two things:


Add the form element, as you already did
Add a submission handler to $form['#submit'] ($form['#submit'][] = 'mymodule_submission_callback';)