內容簡介
這個外掛可讓您在 WordPress 管理後台的內建「說明」選單上新增自訂說明標籤或額外的側邊欄內容,只需將說明檔案放在特定資料夾即可。擴充功能是透過尋找您目前佈景主題中 admin-help/ 資料夾中的檔案,並根據檔案名稱將內容新增至 WordPress 說明系統的畫面上。檔案應以 Markdown 撰寫。
您可以增強任何畫面的說明標籤或側邊欄內容,包括其他外掛創建的屏幕。檔名決定了將內容新增至 WordPress 管理區域中的哪個畫面。
您可以使用任何語言編寫說明內容,外掛會自動載入您網站的正確語言檔案,因此翻譯說明內容非常容易。
例如,如果您經營一個英語網站,想要增強 WordPress 核心或用戶個人資料編輯頁提供的內建說明,只需在 YOUR_THEME/admin-help/en_US/profile.md (其中 YOUR_THEME 是佈景主題資料夾) 增加一個檔案即可。(對於西班牙語網站,請在 YOUR_THEME/admin-help/es_ES/profile.md 中增加檔案)。
外掛用於判斷在哪個畫面上載入哪個檔案時,採用以下規則:
每個說明檔案都包含在與 WordPress 安裝的區域字串匹配的目錄中。通過更改 WordPress 語言設置來控制區域字串。
檔名引用 WP_Screen 類的 $action 和 $id 成員。
檔案可以選擇性地以數字優先順序作為後綴 (較低的數字優先顯示,高於具有較大數字的文件的內容,如WP_Screen文件的內容)。
檔案可以選擇性地以 sidebar- 為前綴,表示該檔案包含的內容適用於說明側邊欄而不是自己的標籤頁面。
特殊檔名 sidebar.md 會追加到顯示屏幕說明的每個 WordPress 管理畫面頁面上的側邊欄。
針對外掛或佈景主題作者
要在您的外掛中使用 WP Screen Help Loader,您只需:
function my_plugin_add_custom_help () {
new WP_Screen_Help_Loader(plugin_dir_path(__FILE__) . 'help');
}
add_action('admin_head', 'my_plugin_add_custom_help');
現在將本地化的說明內容放入您的外掛目錄中的 help/YOUR_LANGUAGE 目錄中即可。就是這樣!
如果您喜歡這個外掛,請考慮捐贈以支持這個外掛,或購買Meitar的網頁開發書籍或直接貢獻給Meitar的Cyberbusking基金。(出版費)
外掛標籤
開發者團隊
原文外掛簡介
Make your site’s on-screen admin help tabs more helpful by adding custom help tabs or additional sidebar content to any screen of the WordPress Admin Dashboard’s built-in “Help” menu simply by placing help files in a special folder.
This plugin looks for files located in your current theme’s admin-help/ folder and, based on their name, adds their content to the WordPress on-screen help menuing system. The files should be written in markdown.
You can augment any screen’s help tabs or help sidebar, including screens created by other plugins. The name of the help file determines which screen in the WordPress admin area the file’s content will be added to.
You can add help content in any language, and the plugin will automatically load the correct language file for your site. This makes translating help content easy.
For instance, if you run an English website and want to augment the built-in help provided by WordPress core or a custom plugin shown on the user’s profile editing page, add a file at YOUR_THEME/admin-help/en_US/profile.md, where YOUR_THEME is the theme folder. (For a Spanish site, add a file to YOUR_THEME/admin-help/es_ES/profile.md.)
The rules used by the plugin to determine which file to load on which screen are as follows:
Each help file is contained within a directory matching the locale string of the WordPress installation. Control the locale string by changing the WordPress language setting.
File names reference the $action and $id members of the WP_Screen class.
Files can be optionally suffixed with a numeric priority (lower numbers display first, above the content of files with larger numbers as per WP_Screen documentation).
Files can be optionally prefixed with sidebar- indicating that the file contains content intended for the help sidebar rather than a tab of its own.
The special filename sidebar.md is appended to the sidebar on every WordPress admin screen page where on-screen help is shown.
For plugin or theme authors
To use WP Screen Help Loader in your plugin, all you need to do is:
function my_plugin_add_custom_help () {
new WP_Screen_Help_Loader(plugin_dir_path(__FILE__) . 'help');
}
add_action('admin_head', 'my_plugin_add_custom_help');
Now put your localized help contents into the help/YOUR_LANGUAGE directory in your plugin directory. That’s it!
If you like this plugin, please consider making a donation for your use of the plugin, purchasing one of Meitar’s web development books or, better yet, contributing directly to Meitar’s Cyberbusking fund. (Publishing royalties ain’t exactly the lucrative income it used to be, y’know?) Your support is appreciated!
