wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_get_toggletip › WordPress Function

Seit7.1.0
Veraltetn/v
wp_get_toggletip ( $content, $args )
Parameter: (2)
  • (string) $content Plain-text tooltip content. An empty value returns an empty string.
    Erforderlich: Ja
  • (array) $args { Optional. Arguments for building the tooltip. @type string $id Unique ID for the popover element. Default is a generated unique ID. @type string $label Accessible label for the toggle button. Default 'Help', matching the default icon. Ignored for tooltips. @type string $close_label Accessible label for the close button. Default 'Close'. @type string $icon Dashicons icon class for the toggle button. Default 'dashicons-editor-help'. Should match the control's visible label. @type string $class Additional class(es) for the wrapping element. Default empty. }
    Erforderlich: Ja
Gibt zurück:
  • (string) Tooltip HTML markup, or an empty string when no content is provided.
Definiert in:
Codex:

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 be used for longer supporting text explaining context.


Quellcode

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