Add hover text (aka tooltips) to content in posts. Handy for providing explanations of names, terms, phrases, abbreviations, and acronyms.
This plugin allows you to easily define help text that appears when a visitor hovers their mouse over a word or phrase in a post or page.
Via the plugin’s settings, simply specify the words or phrases that you want to be associated with hover text, and of course, the desired hover texts themselves. The format is quite simple; an example of which is shown here:
WP => WordPress Matt => Matt Mullenweg The Scooby Shack => the bar where the gang hangs out
Additional features of the plugin controlled both via settings and filters:
Note: This is not the same as my Text Replace plugin, which defines terms or phrases that you want replaced by replacement text when displayed on your site. Text Hover instead adds the hover text as additional information for when visitors hover over the term, which is otherwise displayed in the post as you typed it.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Developer documentation can be found in DEVELOPER-DOCS.md. That documentation covers the numerous hooks provided by the plugin. Those hooks are listed below to provide an overview of what’s available.
c2c_text_hover_filters
: Customize what hooks get text hover applied to them.c2c_text_hover_third_party_filters
: Customize what third-party hooks get text hover applied to them.c2c_text_hover_filter_priority
: Override the default priority for the c2c_text_hover
filter.c2c_text_hover
Customize or override the setting defining all of the text hover terms and their hover texts.c2c_text_hover_comments
: Customize or override the setting indicating if text hover should be enabled in comments.c2c_text_hover_case_sensitive
: Customize or override the setting indicating if text hover should be case sensitive.c2c_text_hover_once
: Customize or override the setting indicating if text hovering should be limited to once per term per piece of text being processed regardless of how many times the term appears.c2c_text_hover_use_pretty_tooltips
: Customize or override the setting indicating if prettier tooltips should be used.text-hover.zip
inside the plugins directory for your site (typically wp-content/plugins/
)Settings
-> Text Hover
admin settings page and customize the settings (namely to define the terms/abbreviations and their explanations).The admin options page for the plugin, where you define the terms/acronyms/phrases and their related hover text
The plugin in action for a post when the mouse is hovering over a defined hover text term using the pretty tooltips
The plugin in action for a post when the mouse is hovering over a defined hover text term using default browser tooltips (in this case, Chrome on OSX)
The plugin currently makes use of the standard HTML tag abbr
to specify the terms and their hover text. Browsers have default handling and display of abbr
. It’s possibly that the CSS for your theme is overriding the default display. I use the following in my site’s styles.css file to ensure it displays for me in the manner I prefer (which, by the same token, you can use more CSS formatting to further format the hover terms) :
abbr { text-decoration: underline dotted #000; }
No. The plugin filters post content on-the-fly.
Yes, if they include strings that you’ve now defined as terms.
By default, the plugin filters the post content, post excerpt fields, widget text, and optionally comments and comment excerpts. You can use the ‘c2c_text_hover_filters’ filter to modify that behavior (see Hooks section).
The easiest way would be to add “the_title” (or some other filter’s name) as a line in the “More filters” setting. That setting allows any additional specified filters to be processed for text hovers.
You can also programmatically add to the list of filters that get processed for text hover terms. See the Hooks section for an example.
By default, yes. There is a setting you can change to make it case insensitive. Or you can use the ‘c2c_text_hover_case_sensitive’ filter (see Hooks section). Note that the option applies to all terms/abbreviations. If you want to selectively have terms/acronyms be case insensitive, you should leave the case sensitive setting checked and add a listing for each case variation you wish to support.
By default, yes. There is a setting you can change so that only the first occurrence of the term in the post gets hovered. Or if you are a coder, you can use the ‘c2c_text_hover_replace_once’ filter (see Hooks section).
Yes, but only if you have the pretty tooltips enabled (via settings or the filter). The class you want to style in your custom CSS is ‘.text-hover-qtip’.
Yes. While this plugin is compatible with many other plugins that modify post and widget text, this plugin has explicit built-in support for Advanced Custom Fields and Elementor, which provide additional content areas. This plugin provides hooks that can be used to enable compatibility with other plugins and themes.
If you know the name of the filter provided by a plugin, you can add it to the “More filters” setting to have its value processed for text hover.
The plugin’s settings page is found at “Settings” -> “Text Hover” in the admin sidebar menu.
In order to see that link in the menu and to access the plugin’s settings page to configure the plugin, you must be logged in as an administrator. More specifically, you must be a user with the ‘manage_options’ and ‘unfiltered_html’ capabilities, which by default are capabilities of the ‘administrator’ role. If you have a custom role, or your administrator role has been customized, such that both capabilities are not assigned to you, then you cannot configure the plugin.
Yes.
Highlights:
This release introduces security hardening to restrict HTML tags that can be used as hover text in fancy tooltips, adds DEVELOPER-DOCS.md, notes compatibility through WP 5.9, and minor settings page and documentation tweaks.
Details:
Highlights:
This feature release adds a new setting to allow for user-specified filters to be processed, updates the plugin framework significantly, improves the plugin settings page, restructures unit test files, notes compatibility through WP 5.7, and more.
Details:
'admin_enqueue_scripts'
action instead of during 'init'
is_plugin_admin_page()
in help_tabs()
instead of reproducing its functionalityis_plugin_admin_page()
is used before 'admin_init'
action is firedis_plugin_admin_page()
to use get_current_screen()
when availablestyle
tagc2c_{PluginName}_Plugin_051
to c2c_Plugin_060
get_c2c_string()
as a getter for translated stringsget_c2c_string()
whitelist_options()
to allowed_options()
add_allowed_options()
instead of deprecated add_option_whitelist()
for WP 5.5+allowed_options
filter instead of deprecated whitelist_options
for WP 5.5+is_wp_version_cmp()
and get_c2c_string()
)is_wp_version_cmp()
as a utility to compare current WP version against a given WP versioncontextual_help()
to be easier to read, and correct function docblocksnumber_format_i18n()
to format integer value within input fieldreadme_url()
to refer to plugin’s readme.txt on plugins.svn.wordpress.orgget_default_filters()
as getter for core filters, third-party filters, or bothtests/
top-level directory bin/
into tests/
tests/bootstrap.php
into tests/phpunit/
tests/*.php
into tests/phpunit/tests/
phpunit.xml
to phpunit.xml.dist
per best practicesget_core_filters()
and get_3rd_party_filters()
to DRY up data reuseHighlights:
This minor release adds a new setting that can allow the plugin to run later to avoid potential conflicts with other plugins, now allows hover strings to begin or end with punctuation, updates its plugin framework, adds a TODO.md file, updates a few URLs to be HTTPS, expands unit testing, and updates compatibility to be WP 4.9-5.4+.
Details:
c2c_text_hover_filter_priority
for filtering hook priority for text hover handlerprintf()
rather than using string concatenationget_filter_names()
as a helper method for getting the default and third-party filter namesunhook_default_filters()
as a helper method to unhook plugin’s default filters hooked to text_hover()
enqueue_scripts()
, options_page_description()
abbr
tag contents or in any tag attributestearDown()
$priority
argument to test_hover_applies_to_default_filters()
reset_options()
callFull changelog is available in CHANGELOG.md.