开发者 | coffee2code |
---|---|
更新时间 | 2022年3月23日 14:10 |
捐献地址: | 去捐款 |
PHP版本: | 4.9 及以上 |
WordPress版本: | 5.9 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
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:
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 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.
'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 directorybin/
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 reusec2c_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()
call