Hi, I found the following issue:

theme_pager_link function utilizes $variables['attributes'] while all related functions: theme_pager_first, theme_pager_last, theme_pager_next, theme_pager_previous do not pass this parameter.

All above functions break apart $variables and than merge them again to array to forward it to theme_pager_link, like this:

function theme_pager_first($variables) {
  $text = $variables['text'];
  $element = $variables['element'];
  $parameters = $variables['parameters'];
  global $pager_page_array;
  $output = '';

  // If we are anywhere but the first page
  if ($pager_page_array[$element] > 0) {
    $output = theme('pager_link', array('text' => $text, 'page_new' => pager_load_array(0, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters));
  }

As you can see while you can set $variables['attributes'] it will never reaches theme_pager_link.
$variables parameter is not passed by reference so the best approach would be to change $variables whatever it needs and forward it to new theme functions:

function theme_pager_first($variables) {
  $element = $variables['element'];
  global $pager_page_array;
  $output = '';

  // If we are anywhere but the first page
  if ($pager_page_array[$element] > 0) {
    $variables['page_new'] = pager_load_array(0, $element, $pager_page_array);
    $output = theme('pager_link', $variables);
  }

Than attributes would reach theme_pager_link.
Links:
theme_pager_link
theme_pager_first
theme_pager_last
theme_pager_next
theme_pager_previous

Comments

Version: 7.38 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.