You are here

function _bootstrap_remove_class in Express 8

Removes a class from an element's attributes array.

// Before.
_bootstrap_remove_class('my-class', $element);

// After.
use Drupal\bootstrap\Utility\Element;
Element::create($element)
  ->removeClass('my-class');

Parameters

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

array $element: The individual renderable array element.

string $property: Determines which attributes array to retrieve. By default, this is the element's normal "attributes", but it could also be one of the following:

  • "content_attributes"
  • "input_group_attributes"
  • "title_attributes"
  • "wrapper_attributes".

Deprecated

Will be removed in a future release.

See also

\Drupal\bootstrap\Utility\Element::removeClass()

File

themes/contrib/bootstrap/deprecated.php, line 574
This contains deprecated functions that will be removed in a future release.

Code

function _bootstrap_remove_class($class, array &$element, $property = 'attributes') {
  Bootstrap::deprecated();
  Element::create($element)
    ->removeClass($class, $property);
}