Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

In the conversion of theme_pager() to Twig, the following theme functions have been removed:

theme_pager_first() 
theme_pager_previous()
theme_pager_next()
theme_pager_last()
theme_pager_link()

The preprocess function now builds a render array, where links are expressed as '#type' => 'link' elements.

A 'pager_context' array is added to the options of the link (see below), so that modules implementing hook_link_alter are supplied with information about the type of link (e.g. first, previous, item, next, last), the pager element to which the link is associated, and the offset of the link page from the current page.

    $li_first = array(
      '#type' => 'link',
      '#title' => $tags[0],
      '#href' => $current_path,
      '#options' => array(
        'query' => pager_query_add_page($parameters, $element, 0),
        'attributes' => array(
          'title' => t('Go to first page'),
          'rel' => 'first',
        ),
        // Below is ignored by default, supplied to support hook_link_alter
        // implementations.
        'pager_context' => array(
          'link_type' => 'first',
          'element' => $element,
        ),
      ),
    );

As an example, to override the path to the "<< first" link you should now add a function like this one:

function mytheme_link_alter(&$variables) {
  if (isset($variables['options']['pager_context'])) {
    if ($variables['options']['pager_context']['link_type']) == 'first') {
      $variables['path'] = ...
    }
  }
}
Impacts: 
Themers