theme_filter_tips() takes an argument $extra that is never used and can be safely removed.

I've searched through all files in core, and it's only invoked by Filter module itself.

Comments

webchick’s picture

Status: Needs review » Needs work

If this really has no use, we should remove it from the theme function declaration in hook_theme().

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new3.32 KB

Boy, I needed to lookup multiple functions to grasp what's actually passed there in $tips.... so I added an example.

dries’s picture

     $extra = '<p>' . l(t('More information about formatting options'), 'filter/tips') . '</p>';
-    $tiplist = theme('filter_tips', $tips, FALSE, $extra);
+    $tiplist = theme('filter_tips', $tips, FALSE);

Note that $extra is now an unused variable. It is, after all, declared. It looks like the the "More information about formatting options" gets lost now?

sun’s picture

StatusFileSize
new3.68 KB

Good catch, but only true for filter_admin_format_form(). Fixed the appending of the more link there, which was not displayed until now, and also did not use the corresponding theme function...

Please note that we most probably want to refactor the whole processing and theming of filter tips (and the ($extra) more link) anyway, but let's discuss this in a new issue and not this one, please. Code clean-up should come first.

dries’s picture

I think this is a good patch, although the @code example tends to raise questions (e.g. what is ID for?). I'm not mandating we add more documentation, so I'll commit this after someone else has reviewed this.

sun’s picture

StatusFileSize
new3.79 KB

I agree that ID should be explained as well. Hopefully ready to go now.

sun’s picture

StatusFileSize
new3.79 KB

Fixed typo "intented".

dries’s picture

Status: Needs review » Fixed

Committed it to CVS HEAD. The extra documentation pushed it over the threshold. ;-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.