You are here

function social_post_photo_update_8002 in Open Social 10.2.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \social_post_photo_update_8002()
  2. 10.0.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \social_post_photo_update_8002()
  3. 10.1.x modules/social_features/social_post/modules/social_post_photo/social_post_photo.install \social_post_photo_update_8002()

Create "Featured" view display for photo post.

File

modules/social_features/social_post/modules/social_post_photo/social_post_photo.install, line 105
The Social post photo installation.

Code

function social_post_photo_update_8002() {
  if (!EntityViewDisplay::load('post.photo.featured')) {
    $display = EntityViewDisplay::load('post.photo.default')
      ->toArray();
    $display = array_merge($display, [
      'uuid' => NULL,
      '_core' => NULL,
      'targetEntityType' => 'post',
      'mode' => 'featured',
    ]);
    EntityViewDisplay::create($display)
      ->save();
  }
}