You are here

public function JuiceboxGallery::removeOption in Juicebox HTML5 Responsive Image Galleries 8.3

Same name and namespace in other branches
  1. 8.2 src/JuiceboxGallery.php \Drupal\juicebox\JuiceboxGallery::removeOption()

Remove an option from the gallery.

Parameters

string $option_name: The name of an existing option that was already added to the gallery. This name should match the index for the option as returned by getOptions().

Return value

bool Returns TRUE on successful removal and FALSE on failure.

Overrides JuiceboxGalleryInterface::removeOption

File

src/JuiceboxGallery.php, line 198

Class

JuiceboxGallery
Class to generate the script and markup for a Juicebox gallery.

Namespace

Drupal\juicebox

Code

public function removeOption($option_name) {
  $option_name = strtolower($option_name);
  if (!empty($this->options[$option_name])) {
    unset($this->options[$option_name]);
    return TRUE;
  }
  return FALSE;
}