Last active
November 16, 2017 11:34
-
-
Save macgraphic/d80b58a24b7240c0a1a73c528fcf7dbb to your computer and use it in GitHub Desktop.
Adds the foundation Tooltip as a shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Shortcode | |
function foundation_tooltip( $atts ) { | |
// Attributes | |
$atts = shortcode_atts( | |
array( | |
'content' => 'Default Content', | |
'title' => 'Default title', | |
), | |
$atts, | |
'tooltip' | |
); | |
return('<span data-tooltip aria-haspopup="true" class="has-tip" data-disable-hover="false" tabindex="2" title=" ' . $atts['title'] . ' ">' . $atts['content'] . '</span> '); | |
} | |
add_shortcode( 'tooltip', 'foundation_tooltip' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add to functions.php, or into a custom plugin.
// example: the word [tooltip title="Iam the tip" content="hinted text"]