Guide

Advanced Description hooks

The add-on renders a description panel and a tooltip on the choice's info icon. It exposes two hooks of its own, and participates in one core hook.

See the hook reference index for how to register PHP and JavaScript callbacks.

PHP filters

HookArgumentsPurpose
mkl_pc/advanced_description/icon$iconThe SVG markup for the "show more information" icon

JavaScript filters

HookArgumentsPurpose
PC.fe.advanced-description.tooltip.optionsoptions, viewTippy.js options for the info-icon tooltip

mkl_pc/advanced_description/icon

Filters the icon markup printed into the description template. The default references the plugin's sprite (#mkl-icon-info); return any markup you like, including an <img>.

php functions.php
add_filter( 'mkl_pc/advanced_description/icon', function ( $icon ) {	return '<span class="dashicons dashicons-info"></span>';} );
mkl_pc/advanced_description/icon.

PC.fe.advanced-description.tooltip.options

The tooltip is Tippy.js, and this filter receives its full options object just before the instance is created. The second argument is the choice view.

Note the ordering: the add-on first runs the core PC.fe.tooltip.options filter, then this one. Use this hook when you want to change the description tooltip only, and the core hook when you want every configurator tooltip to match.

javascript custom.js
wp.hooks.addFilter(	'PC.fe.advanced-description.tooltip.options',	'my-plugin/adv-desc',	function ( options, view ) {		options.placement = 'right';		options.delay = [ 300, 0 ];		return options;	});
PC.fe.advanced-description.tooltip.options.

If options.content comes back empty, no tooltip is created at all — returning an empty string is the way to suppress one.

Core hooks it also fires

PC.fe.tooltip.options — see the Product Configurator JavaScript hooks.