Override ctools function I'm using the Multi-Step Registration module to have a wizard in my user registration. The wizard works fine. You can also select a wizard trail to see in which step you are.



As you can see it displays that you can customize it by theming ctools_wizard_trail__step. Now the html code of the wizard is like this:

&lt;div class="wizard-trail"&gt;
    &lt;span class="wizard-trail-previous"&gt;Register&lt;/span&gt; » 
    &lt;span class="wizard-trail-previous"&gt;Geslacht&lt;/span&gt; » 
    &lt;span class="wizard-trail-previous"&gt;Politiek actief&lt;/span&gt;
    .......
&lt;/div&gt;


This is what I've done so far in the function:

function mytheme_ctools_wizard_trail__step($html) {
    $wizard = $html['trail'];
    $steps = ['', 'geslacht', 'politiek_actief', 'beroep', 'vakgebied', 'berichten_ontvangen', 'nicknames', 'other'];
    for($i = 0; $i &lt; count($steps); $i++)
    {
        $step_name = (string)$steps[$i];
        $wizard_html = (string)$wizard[$i];
        $wizard[$i] = "&lt;a href='/user/register/" . $step_name . "'&gt;" . $wizard_html . "&lt;/a&gt;";
    }
    $html['trail'] = $wizard;
}


When I dump the $html variable on the first line of the function (before any operations) I get this result:

array (size=1)
    'trail' =&gt;
       array (size=8)
          0 =&gt; string '&lt;span class="wizard-trail-previous"&gt;Register&lt;/span&gt;' (length=51)
          1 =&gt; string '&lt;span class="wizard-trail-previous"&gt;Geslacht&lt;/span&gt;' (length=51)
          2 =&gt; string '&lt;span class="wizard-trail-previous"&gt;Politiek actief&lt;/span&gt;' (length=58)
          3 =&gt; string '&lt;span class="wizard-trail-previous"&gt;Beroep&lt;/span&gt;' (length=49)
          4 =&gt; string '&lt;span class="wizard-trail-previous"&gt;Vakgebied&lt;/span&gt;' (length=52)
          5 =&gt; string '&lt;span class="wizard-trail-current"&gt;Berichten ontvangen&lt;/span&gt;' (length=61)
          6 =&gt; string '&lt;span class="wizard-trail-next"&gt;Nicknames&lt;/span&gt;' (length=48)
          7 =&gt; string '&lt;span class="wizard-trail-next"&gt;Other&lt;/span&gt;' (length=44)


When I dump the $html variable on my last rule of the function I get this:

array (size=1)
   'trail' =&gt;
      array (size=8)
         0 =&gt; string '&lt;a href='/user/register/'&gt;&lt;span class="wizard-trail-previous"&gt;Register&lt;/span&gt;&lt;/a&gt;' (length=81)
         1 =&gt; string '&lt;a href='/user/register/geslacht'&gt;&lt;span class="wizard-trail-previous"&gt;Geslacht&lt;/span&gt;&lt;/a&gt;' (length=89)
         2 =&gt; string '&lt;a href='/user/register/politiek_actief'&gt;&lt;span class="wizard-trail-previous"&gt;Politiek actief&lt;/span&gt;&lt;/a&gt;' (length=103)
         3 =&gt; string '&lt;a href='/user/register/beroep'&gt;&lt;span class="wizard-trail-previous"&gt;Beroep&lt;/span&gt;&lt;/a&gt;' (length=85)
         4 =&gt; string '&lt;a href='/user/register/vakgebied'&gt;&lt;span class="wizard-trail-previous"&gt;Vakgebied&lt;/span&gt;&lt;/a&gt;' (length=91)
         5 =&gt; string '&lt;a href='/user/register/berichten_ontvangen'&gt;&lt;span class="wizard-trail-current"&gt;Berichten ontvangen&lt;/span&gt;&lt;/a&gt;' (length=110)
         6 =&gt; string '&lt;a href='/user/register/nicknames'&gt;&lt;span class="wizard-trail-next"&gt;Nicknames&lt;/span&gt;&lt;/a&gt;' (length=87)
         7 =&gt; string '&lt;a href='/user/register/other'&gt;&lt;span class="wizard-trail-next"&gt;Other&lt;/span&gt;&lt;/a&gt;' (length=79)


It looks the same but my wizard is gone ... . It's not added to my html.. .
What could be the problem of this?
You're not returning any markup from the theme function. The purpose of a theme function is to optionally accept some arguments and return markup. Here's an example of a theme function returning markup.

For more information see Overriding themable output.