Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295813

Remove theme_more_help_link() and replace with a #type link render array

$
0
0

Current code

<?php
function theme_more_help_link($variables) {
  return
'<div class="more-help-link">'. l(t('More help'), $variables['url']) . '</div>';
}
?>

Render array to replace that:

<?php
      $more_help_link
= array(
       
'#type'=> 'link',
       
'#href'=> 'admin/help/forum',
       
'#title'=> t('More help'),
      );
     
$container = array(
       
'#theme'=> 'container',
       
'#children'=>  drupal_render($more_help_link),
       
'#attributes'=> array(
         
'class'=> array('more-help-link'),
        ),
      );
     
$output = drupal_render($container);
?>

Part of #1595614: [meta] Remove all the theme functions in core that simply output a link. Replace with #type 'link' render arrays

Related: #1939094: Convert theme_more_help_link() to Twig


Viewing all articles
Browse latest Browse all 295813

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>