function ds_prepare_machine_name in Display Suite 7
Same name and namespace in other branches
- 8.2 drush/ds.drush.inc \ds_prepare_machine_name()
- 8.3 drush/ds.drush.inc \ds_prepare_machine_name()
- 7.2 drush/ds.drush.inc \ds_prepare_machine_name()
Prepare a string for use as a valid machine name.
5 calls to ds_prepare_machine_name()
- drush_ds_build in ./
ds.drush.inc - Create a basic template and configuration file for a new Display Suite layout.
- ds_prepare_regions_configuration in ./
ds.drush.inc - Prepare configuration for an array of regions.
- ds_prepare_regions_css in ./
ds.drush.inc - Prepare styling for an array of regions.
- ds_prepare_regions_html in ./
ds.drush.inc - Prepare HTML structure for an array of regions.
- ds_prepare_regions_variable_documentation in ./
ds.drush.inc - Prepare variable documentation for an array of regions.
File
- ./
ds.drush.inc, line 128 - Display Suite drush integration.
Code
function ds_prepare_machine_name($string) {
$machine_name = str_replace(' ', '_', drupal_strtolower($string));
// Remove characters not valid in function names.
$machine_name = preg_replace('/[^a-z0-9_]/', '', $machine_name);
return $machine_name;
}