- Rename `opdavies_blog` to `blog`. - Rename `opdavies_blog_test` to `blog_test`. - Rename `opdavies_talks` to `talks`. - Rename `opdavies_talks_test` to `talks_test`. The files within the directories haven't changed, so there is no breaking change caused by renaming the directories. Please enter the commit message for your changes. Lines starting
21 lines
372 B
PHP
21 lines
372 B
PHP
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Node preprocess functions.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* Implements hook_preprocess_HOOK().
|
|
*/
|
|
function opdavies_blog_preprocess_node(array &$variables): void {
|
|
if (!method_exists($variables['node'], 'getExternalLink')) {
|
|
return;
|
|
}
|
|
|
|
if ($link = $variables['node']->getExternalLink()) {
|
|
$variables['url'] = $link['uri'];
|
|
}
|
|
}
|