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