wp_get_toggletip()WP 7.1.0

Retrieves the markup for an accessible toggle tip.

Returns a button and an action triggered toggle tip with $content.

No Hooks.

Returns

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

Usage

wp_get_toggletip( $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)
    Existing button markup. Used instead of generated button.
    Default: standard button HTML

  • label(string)
    Accessible label for the toggle button. Ignored for tooltips.
    Default: 'Help', matching the default icon

  • close_label(string)
    Accessible label for the close button.
    Default: 'Close'

  • 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_toggletip() code WP 7.1

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