function _bootstrap_remove_class

8.x-3.x deprecated.php _bootstrap_remove_class($class, array &$element, $property = 'attributes')
7.x-3.x _bootstrap_remove_class($class, array &$element, $property = 'attributes')

Removes a class from an element's render array.


string|array $class: An individual class or an array of classes to remove.

array $element: The individual renderable array element. It is possible to also pass the $variables parameter in [pre]process functions and it will logically determine the correct path to that particular theme hook's classes array. Passed by reference.

string $property: Determines which attributes array to retrieve. By default, this is the normal attributes, but can be "wrapper_attributes" or "input_group_attributes".

Related topics

Source includes/ (line 607)

function _bootstrap_remove_class($class, array &$element, $property = 'attributes') {
  // Retrieve the element's classes.
  $classes = &_bootstrap_get_classes($element, $property);

  // Convert the class to an array.
  if (!is_array($class)) {
    $class = array($class);

  // Iterate over all classes to add.
  foreach ($class as $_class) {
    $key = array_search($_class, $classes);
    if ($key !== FALSE) {