Change record status: 
Introduced in branch: 


  • theme_link has been removed from core in order to improve rendering performance and because it no longer provides any benefits over calling l() directly.
  • The attributes '#text' and '#path' have been changed to '#title' and '#href' respectively in order to provide consistent attribute naming throughout the Render API and Form API.
  • Themers should replace '#theme' => 'link' with '#type' => 'link' in any render arrays, while also changing '#text' to '#title' and '#path' to '#href'.
  • An '#options' attribute can be specified that will be passed to l() (and url() internally within l()) to specify extra options for the link such as query parameters, HTML attributes, etc.
  • See #1985470-10: Remove theme_link() for the reasoning behind this change.
  • Themers should replace any hook_preprocess_link() implementations with a hook_link_alter() implementation. hook_link_alter() was added in #1922454: Gut l(), fix theme('link'), have a working framework for consistently generated links inside and outside of Twig.

Code example:

Before (D7):

$link_array = array(
  '#theme' => 'link',
  '#text' => 'The text to render inside the <a> tag',
  '#path' => '',

After (D8):

$link_array = array(
  '#type' => 'link',
  '#title' => 'The text to render inside the <a> tag',
  '#href' => '',

For additional examples demonstrating usage of both '#options' and hook_link_alter(), please reference

Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other updates done