Retrieves the markup for an accessible tooltip or toggletip.
Returns a button and either a hover/focus triggered tooltip popover or an action triggered toggle tip. Enqueue the wp-tooltip style and script where it is used. Tooltips are used to show the accessible name of a control. Toggletips are used for longer supporting text explaining context.
Хуков нет.
Возвращает
string. Tooltip HTML markup, or an empty string when no content is provided.
Использование
wp_get_tooltip_helper( $content, $args );
$content(строка) (обязательный)
Plain-text tooltip content. An empty value returns an empty string.
$args(массив)
Arguments for building the tooltip.
По умолчанию: array()
id(строка)
Unique ID for the popover element. По умолчанию: generated unique ID
button(строка)
Existing button or a markup. Used instead of generated button. По умолчанию: empty string
label(строка)
Accessible label for the toggle button. Ignored for tooltips. По умолчанию: 'Help', matching the default icon
close_label(строка)
Accessible label for the close button. По умолчанию: 'Close'
icon(строка)
Dashicons icon class for the toggle button. Should match the control's visible label. По умолчанию: 'dashicons-editor-help'
class(строка)
Additional class(es) for the wrapping element. По умолчанию: ''
type(строка)
Type of tooltip: either tooltip or toggletip. По умолчанию: 'tooltip'
Список изменений
С версии 7.1.0
Введена.
Код wp_get_tooltip_helper() wp get tooltip helper WP 7.1.4