By utkarsh_33 on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.2.x
Introduced in version:
10.2.0
Issue links:
Description:
If a template becomes outdated, there's now a way to mark it as deprecated. This can be done by using a new deprecated key which can be used in the hook_theme implementations returned by hook_theme(). The value contains a deprecation message that serves as a notification to site builders and developers about the deprecation of a specific template.
/**
* Implements hook_theme().
*/
function mymodule_theme() {
return [
'mymodule_custom_template' => [
'variables' => ['content' => NULL],
'deprecated' => 'The "mymodule_custom_template" template is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another template instead. See https://www.example.com',
],
];
}
Impacts:
Module developers