wp_get_tooltip( string $content, array $args = array() ): string

Retrieves the markup for an accessible tooltip.

Description

Returns a button with an accessible name popover hint.

Parameters

$contentstringrequired
Plain-text tooltip content. An empty value returns an empty string.
$argsarrayoptional
Arguments for building the tooltip.
  • id string
    Unique ID for the popover element. Default is a generated unique ID.
  • button string
    Existing button or a markup. 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.
    Default 'dashicons-editor-help'. Should match the control’s visible label.
  • class string
    Additional class(es) for the wrapping element.

Default:array()

Return

string Tooltip HTML markup, or an empty string when no content is provided.

Source

function wp_get_tooltip( $content, $args = array() ) {
	$args['type'] = 'tooltip';
	return wp_get_tooltip_helper( $content, $args );
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.