function drupal_clean_css_identifier

cis7 common.inc drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => ''))
cle7 common.inc drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => ''))
elmsmedia7 common.inc drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => ''))
icor7 common.inc drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => ''))
meedjum_blog7 common.inc drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => ''))
mooc7 common.inc drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => ''))

Prepares a string for use as a CSS identifier (element, class, or ID name).

http://www.w3.org/TR/CSS21/syndata.html#characters shows the syntax for valid CSS identifiers (including element names, classes, and IDs in selectors.)

Parameters

$identifier: The identifier to clean.

$filter: An array of string replacements to use on the identifier.

Return value

The cleaned identifier.

20 calls to drupal_clean_css_identifier()
breakpoints_breakpoints_group_override in sites/all/modules/local_contrib/breakpoints/breakpoints.module
Override the breakpoints of a group.
ctools_stylizer_edit_style_form_choose in sites/all/modules/ulmus/ctools/includes/stylizer.inc
Choose which plugin to use to create a new style.
drupal_html_class in includes/common.inc
Prepares a string for use as a valid class name.
field_collection_field_formatter_view in sites/all/modules/ulmus/field_collection/field_collection.module
Implements hook_field_formatter_view().
google_chart_tools_views_plugin_style::render in sites/all/modules/local_contrib/google_chart_tools/google_chart_tools_views/views/google_chart_tools_views_plugin_style.inc
Render the display in this style.

... See full list

2 string references to 'drupal_clean_css_identifier'
ctools_process in sites/all/modules/ulmus/ctools/ctools.module
Implements hook_process().
template_preprocess_media_views_view_media_browser in sites/all/modules/ulmus/media/media.views.inc
Display the view as a media browser.

File

includes/common.inc, line 3812
Common functions that many Drupal modules will need to reference.

Code

function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')) {
  // By default, we filter using Drupal's coding standards.
  $identifier = strtr($identifier, $filter);

  // Valid characters in a CSS identifier are:
  // - the hyphen (U+002D)
  // - a-z (U+0030 - U+0039)
  // - A-Z (U+0041 - U+005A)
  // - the underscore (U+005F)
  // - 0-9 (U+0061 - U+007A)
  // - ISO 10646 characters U+00A1 and higher
  // We strip out any character not in the above list.
  $identifier = preg_replace('/[^\x{002D}\x{0030}-\x{0039}\x{0041}-\x{005A}\x{005F}\x{0061}-\x{007A}\x{00A1}-\x{FFFF}]/u', '', $identifier);

  return $identifier;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.