You are here

function _social_demo_convert_content_types in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  2. 8.2 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  3. 8.3 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  4. 8.4 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  5. 8.5 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  6. 8.6 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  7. 8.7 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  8. 8.8 modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  9. 10.3.x modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  10. 10.0.x modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  11. 10.1.x modules/custom/social_demo/social_demo.drush.inc \_social_demo_convert_content_types()
  12. 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];
    }
  }
}