[WordPress] 外掛分享: ACF Tooltip

首頁外掛目錄 › ACF Tooltip
WordPress 外掛 ACF Tooltip 的封面圖片
2,000+
安裝啟用
★★★★★
5/5 分(5 則評價)
471 天前
最後更新
問題解決
WordPress 4.7+ v1.2.5 上架:2017-03-20

內容簡介

如果ACF字段需要更長的指示文字,編輯頁面的版面會變得凌亂,浪費很多空間。
ACF Tooltip外掛程序隱藏了字段指示,將幫助符號添加到字段標籤上,並基於指示文本生成工具提示框。
版本1.2.0中的新功能
如果懸停,工具提示窗口將不會隱藏,從而允許在其中創建帶有鏈接項目的工具提示。
自定義設置
有7個過濾器可調整工具提示框的設計和行為。
此外掛程式僅適用於ACF PRO(版本5.5.0或更高版本)。
本地化

英語
德語

使用過濾器鉤子進行自定義設置
有7個過濾器可調整工具提示框的設計和行為。
設置工具提示框的設計
<?php
function acf_tooltip_style() {
$style = 'qtip-acf';

return $style;
}
add_filter('acf/tooltip/style','acf_tooltip_style');
?>

可在qTip選項頁面上找到可用的樣式,並在qTip演示網站上顯示。您可以混合使用樣式,例如 "qtip-acf qtip-rounded qtip-shadow"。如果需要,您可以定義自己的樣式,使用自己CSS文件的類名(下一個過濾器中有說明)。qtip-acf樣式是標準樣式,無需過濾器即可設置。
定義您自己的CSS樣式表
<?php
function acf_tooltip_css() {
$css_file = get_bloginfo('template_url') . '/qtip-own.css'; // 如果在主題文件夾中保存此文件

返回$css_file;
}
add_filter('acf/tooltip/css','acf_tooltip_css');
?>

您可以在 /assets/css 文件夾中找到 "qtip-example-style.css" 文件。
定位工具提示框的角落
<?php
function acf_tooltip_position_my() {
$position_my = 'center left';

return $position_my;
}
add_filter('acf/tooltip/position/my','acf_tooltip_position_my');
?>

相對於工具提示符號的位置
<?php
function acf_tooltip_position_at() {
$position_at = 'center right';

return $position_at;
}
add_filter('acf/tooltip/position/at','acf_tooltip_position_at');
?>

訪問 qTip 演示網站,找到最佳位置。
僅將工具提示應用於具有特定類的字段
<?php
function acf_tooltip_class() {
$class = 'with__tooltip'; // 按您喜好的類名編輯

return $class;
}
add_filter('acf/tooltip/class/only','acf_tooltip_class');
?>

請將該類添加到需要顯示工具提示框的字段中。
排除具有特定類別的字段中的工具提示
<?php
function acf_tooltip_class_exclude() {
$class = 'no__tooltip'; // 按您喜好的類名編輯

返回$class;
}
add_filter('acf/tooltip/class/exclude','acf_tooltip_class_exclude');
?>

請將該類添加到不想顯示工具提示框的字段中。
在字段編輯器中添加工具提示
使用此過濾器可以指定是否顯示字段指示。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.2.5) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「ACF Tooltip」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

If an ACF field requires a longer instruction text, the layout of the edit screen is messy and a lot of space is wasted.
The ACF Tooltip plugin hides the field instructions, adds a help symbol to the field labels and generates a tooltip based on the instruction text.
New in Version 1.2.0
The tooltip will not hide if moused over, allowing create a tooltip with a link inside without hiding the tooltip.
Custom settings
There are 7 filters that allow adjusting the design and the behavior of the tooltips.
This plugin works only with the ACF PRO (version 5.5.0 or higher).
Localizations

English
Deutsch

Custom settings with filter hooks
There are 7 filters that allow adjusting the design and the behavior of the tooltips can be adjusted.
Set the design of the tooltips

The available styles can be found on the qTip options page and are shown on the qTip demo site.
You can mix the styles; e.g. “qtip-acf qtip-rounded qtip-shadow”
If you like, you can define your own style, with the class name of your style from your own CSS file (see next filter).
The qtip-acf style is the standard style, which is set without a filter.
Define your own CSS file

You will find a ‘qtip-example-style.css’ in the ‘/assets/css’ folder.
Positioning the corner of the tooltip

Position in relation to the tooltip icon

Check out the qTip demo site to find your perfect positioning.
Apply tooltips only to fields with specific class

Add the class to the fields where you want to show tooltips.
Exclude tooltips on fields with specific class

Add the class to the fields where you don’t want to show tooltips.
Add tooltips to the Field Editor
With this filter, you can specify whether the instructions in the Field Editor are displayed as tooltips as well. By default, the instructions are displayed.

延伸相關外掛

文章
Filter
Mastodon