You are here

private function RiddlerSettingsForm::recursiveUnset in Captcha Riddler 8

Remove elements from an array by key.

1 call to RiddlerSettingsForm::recursiveUnset()
RiddlerSettingsForm::submitForm in src/Form/RiddlerSettingsForm.php
Form submission handler.

File

src/Form/RiddlerSettingsForm.php, line 221

Class

RiddlerSettingsForm
Displays the Riddler settings form.

Namespace

Drupal\riddler\Form

Code

private function recursiveUnset(&$array, $unwanted_key) {
  unset($array[$unwanted_key]);
  foreach ($array as &$value) {
    if (is_array($value)) {
      $this
        ->recursiveUnset($value, $unwanted_key);
    }
  }
}