You are here

function ds_update_8001 in Display Suite 8.4

Same name and namespace in other branches
  1. 8.2 ds.install \ds_update_8001()
  2. 8.3 ds.install \ds_update_8001()

Disable adding entity, bundle, view mode classes per display.

File

./ds.install, line 20
Display Suite install file.

Code

function ds_update_8001() {

  /** @var \Drupal\Core\Entity\Display\EntityDisplayInterface $display */
  foreach (EntityViewDisplay::loadMultiple() as $display) {
    $ds = $display
      ->getThirdPartySetting('ds', 'layout');
    if (!empty($ds)) {
      $ds['entity_classes'] = 'old_view_mode';
      $display
        ->setThirdPartySetting('ds', 'layout', $ds)
        ->save();
    }
  }
}