1 layout.module _layout_clean_custom_css($classes = array())

Utility function to clean CSS for Layout UI.


string $classes: CSS classes, as entered into the Layout user interface.

Return value

string: String of sanitized classes separated by spaces.


core/modules/layout/layout.module, line 2643
The Layout module creates pages and wraps existing pages in layouts.


function _layout_clean_custom_css($classes = array()) {
  if (!empty($classes)) {
    $new_classes = explode(' ', $classes);
    foreach ($new_classes as $class) {
      $clean_classes[] = backdrop_clean_css_identifier($class, array());

    $clean_classes = array_filter($clean_classes);
    return implode(' ', $clean_classes);

  return '';