Filter

pre tooltips

floorplans.tooltipfilter(
array tooltip,
node element );

Filters tooltips html. Please note this filter is implemented in JavaScript.

Parameters

tooltip
(array) The tooltip contents.
element
(node) The element the tooltip is for.

Source

floorplans/public/js/controls.js

More Information

Not technically a WordPress filter, however this filter can be used to change the contents of tooltips in JavaScript.

This code should be implemented in JavaScript. For extra guidance, please see WPBeginner’s tutorial on adding custom javascript.

Example

<script type="text/javascript">

	floorplans.tooltipfilter = function( tooltip, element ){

		if(element.dataset['id']!=='2') return tooltip;

		tooltip.content = 'This is a nice element.';
		tooltip.image   = '<img src="https://example.com/test.jpg">';

		return tooltip;
	}

</script>
filed under: