wp_get_tooltip()
Retrieves the markup for an accessible tooltip.
Returns a button with an accessible name popover hint.
No Hooks.
Returns
string. Tooltip HTML markup, or an empty string when no content is provided.
Usage
wp_get_tooltip( $content, $args );
- $content(string) (required)
- Plain-text tooltip content. An empty value returns an empty string.
- $args(array)
Arguments for building the tooltip.
Default:
array()-
id(string)
Unique ID for the popover element.
Default: generated unique ID -
button(string)
Existingbuttonoramarkup. Used instead of generated button.
Default: standard button HTML -
label(string)
Not used for tooltips. -
close_label(string)
Not used for tooltips. -
icon(string)
Dashicons icon class for the toggle button. Should match the control's visible label.
Default: 'dashicons-editor-help' - class(string)
Additional class(es) for the wrapping element.
Default: ''
-
Changelog
| Since 7.1.0 | Introduced. |
wp_get_tooltip() wp get tooltip code WP 7.1
function wp_get_tooltip( $content, $args = array() ) {
$args['type'] = 'tooltip';
return wp_get_tooltip_helper( $content, $args );
}