social_metatag.post_update.php in Open Social 10.1.x
Same filename and directory in other branches
- 8.9 modules/custom/social_metatag/social_metatag.post_update.php
- 8.5 modules/custom/social_metatag/social_metatag.post_update.php
- 8.6 modules/custom/social_metatag/social_metatag.post_update.php
- 8.7 modules/custom/social_metatag/social_metatag.post_update.php
- 8.8 modules/custom/social_metatag/social_metatag.post_update.php
- 10.3.x modules/custom/social_metatag/social_metatag.post_update.php
- 10.0.x modules/custom/social_metatag/social_metatag.post_update.php
- 10.2.x modules/custom/social_metatag/social_metatag.post_update.php
Contains post-update hooks for the Social Metatag module.
File
modules/custom/social_metatag/social_metatag.post_update.phpView source
<?php
/**
* @file
* Contains post-update hooks for the Social Metatag module.
*/
use Symfony\Component\Yaml\Yaml;
/**
* Correctly import the default topic metatag configuration.
*/
function social_metatag_post_update_0001_fix_node_topic_defaults() {
$config_yaml = <<<YAML
langcode: en
status: true
dependencies: { }
id: node__topic
label: 'Content: Topic'
tags:
title: '[current-page:title]'
og_description: '[node:body]'
og_image: '[node:field_topic_image:entity:url]'
og_site_name: '[site:name]'
og_title: '[current-page:title]'
YAML;
$default_config = Yaml::parse($config_yaml);
$topic_config = \Drupal::configFactory()
->getEditable('metatag.metatag_defaults.node__topic');
$topic_config
->setData($default_config)
->save(TRUE);
}
Functions
Name![]() |
Description |
---|---|
social_metatag_post_update_0001_fix_node_topic_defaults | Correctly import the default topic metatag configuration. |