wxt-8.x-3.011/modules/custom/wxt_ext/wxt_ext_media_slideshow/wxt_ext_media_slideshow.install
modules/custom/wxt_ext/wxt_ext_media_slideshow/wxt_ext_media_slideshow.install
<?php
/**
* @file
* Install and uninstall functions for the WxT installation profile.
*/
/**
* Implements hook_install().
*/
function wxt_ext_media_slideshow_install() {
// Do not do anything during config sync.
if (\Drupal::isConfigSyncing()) {
return;
}
$config = \Drupal::configFactory()->getEditable("core.entity_form_display.media.image.default");
$hidden_components = $config->get('hidden');
unset($hidden_components['field_image_link']);
$config->set('hidden', $hidden_components);
$content = $config->get('content');
$content['field_image_link'] = [
'type' => 'link_default',
'weight' => 1,
'region' => 'content',
'settings' => [
'placeholder_url' => '',
'placeholder_title' => '',
],
'third_party_settings' => [],
];
$config->set('content', $content);
$config->save();
$config = \Drupal::configFactory()->getEditable("core.entity_form_display.media.image.media_browser");
$hidden_components = $config->get('hidden');
unset($hidden_components['field_image_link']);
$config->set('hidden', $hidden_components);
$content = $config->get('content');
$content['field_image_link'] = [
'type' => 'link_default',
'weight' => 1,
'region' => 'content',
'settings' => [
'placeholder_url' => '',
'placeholder_title' => '',
],
'third_party_settings' => [],
];
$config->set('content', $content);
$config->save();
}
