norcross / gravity-tooltips

Adds a custom field to each form element for tooltips
MIT License
74 stars 20 forks source link

Multiple Tooltips on fields with multiple labels #2

Closed SunnyRed closed 10 years ago

SunnyRed commented 10 years ago

If you chose the option "Insert tooltip icon next to label" you may end up with fields with multiple tooltips due to multiple labels (e.g. radio buttons).

I think inside the render_tooltip_icon method this might be a fix, as it only replaces the first instance of a closing label tag.

// drop our tooltip on there $needle = '</label>'; $pos = strpos($content, $needle); if ($pos !== false) { $content = substr_replace($content, $needle . $icon , $pos, strlen($needle)); }

Still, many thanks, best wishes Sunny

norcross commented 10 years ago

this has been corrected in the recent version