You are here

function _social_core_set_favicon in Open Social 10.3.x

Same name and namespace in other branches
  1. 10.1.x modules/social_features/social_core/social_core.module \_social_core_set_favicon()
  2. 10.2.x modules/social_features/social_core/social_core.module \_social_core_set_favicon()

Used to set the favicon of GIN to open socials logo.

1 call to _social_core_set_favicon()
social_core_install in modules/social_features/social_core/social_core.install
Implements hook_install().

File

modules/social_features/social_core/social_core.module, line 1085
The Social core module.

Code

function _social_core_set_favicon() {
  $config = \Drupal::configFactory()
    ->getEditable('gin.settings');
  if (!empty($config
    ->getRawData())) {
    $gin_config = $config
      ->getRawData();

    // Update the favicon in GIN.
    $gin_config['favicon']['use_default'] = FALSE;
    $gin_config['favicon']['path'] = 'themes/contrib/socialblue/favicon.ico';
    $gin_config['favicon']['mimetype'] = 'image/vnd.microsoft.icon';
    $config
      ->setData($gin_config);
    $config
      ->save();
  }
}