function _social_demo_convert_content_types in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 8.2 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 8.3 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 8.4 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 8.5 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 8.6 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 8.7 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 8.8 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 10.3.x modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 10.0.x modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 10.1.x modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
- 10.2.x modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
Convert old keys of content types to new.
Parameters
array $content_types: Array containing content types.
2 calls to _social_demo_convert_content_types()
- drush_social_demo_add in modules/
custom/ social_demo/ social_demo.drush.inc - Add demo content.
- drush_social_demo_remove in modules/
custom/ social_demo/ social_demo.drush.inc - Remove demo content.
File
- modules/
custom/ social_demo/ social_demo.drush.inc, line 142 - Contains social_demo.drush.inc.
Code
function _social_demo_convert_content_types(array &$content_types = []) {
$replacements = [
'eventenrollment' => 'event_enrollment',
'eventtype' => 'event_type',
'likes' => 'like',
];
foreach ($content_types as &$content_type) {
if (isset($replacements[$content_type])) {
$content_type = $replacements[$content_type];
}
}
}