[WordPress] 外掛分享: FA WP Admin Menu Icons

首頁外掛目錄 › FA WP Admin Menu Icons
100+
安裝啟用
★★★★
4.2/5 分(5 則評價)
42 天前
最後更新
問題解決
WordPress 4.4+ PHP 8.1+ v9.1.0 上架:2017-03-24

內容簡介

在 GitHub 上查看,以獲得更好的文件

FA WP Admin Menu Icons 允許您使用 Font Awesome 圖示為 WordPress 自訂文章類型和自訂菜單頁面傳遞 Font Awesome 類字符串,就像在前端使用 Font Awesome 一樣

這裡是一個例子:

register_post_type( 'custom_post_type', [
//...
'menu_icon' => 'fas fa-thumbs-up',
//...
] );

用法
`register_post_type()`

使用 Font Awesome 類字符串來為您的自訂文章類型使用 Font Awesome 圖示,請在 register_post_type() 上使用 Font Awesome 類字符串以參數 $args['menu_icon]:

register_post_type( 'custom_post_type', [
//...
'menu_icon' => 'fa-solid fa-thumbs-up',
//...
] );

`add_menu_page()`

使用 Font Awesome 類字符串來為您的自訂菜單頁面使用 Font Awesome 圖示,請在 add_menu_page() 上使用 Font Awesome 類字符串以參數 $icon_url:

add_menu_page(
page_title: 'Custom Menu Page',
menu_title: 'Custom Menu Page',
capability: 'manage_options',
menu_slug: 'custom_menu_page',
icon_url: 'fa-solid fa-thumbs-up',
);

Custom Post Type UI 插件

使用 Font Awesome 類字符串來為添加或編輯文章類型時的菜單圖示欄位使用 Font Awesome 圖示,請使用 Custom Post Type UI 插件

注意事項

FA WP Admin Menu Icons 僅支援 Font Awesome 的 免費圖示

外掛標籤

開發者團隊

⬇ 下載最新版 (v9.1.0) 或搜尋安裝

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

原文外掛簡介

View on GitHub for better documentation
FA WP Admin Menu Icons allows you to use Font Awesome icons for WordPress custom post types and custom menu pages by passing the Font Awesome class string, just like using Font Awesome on the front end
Here’s an example:
register_post_type( 'custom_post_type', [
//...
'menu_icon' => 'fa-solid fa-thumbs-up',
//...
] );

Usage
`register_post_type()`
To use a Font Awesome icon for your custom post type with register_post_type(), use a Font Awesome class string for the $args['menu_icon] parameter:
register_post_type( 'custom_post_type', [
//...
'menu_icon' => 'fa-solid fa-thumbs-up',
//...
] );

`add_menu_page()`
To use a Font Awesome icon for your custom menu page with add_menu_page(), use a Font Awesome class string for the $icon_url parameter:
add_menu_page(
page_title: 'Custom Menu Page',
menu_title: 'Custom Menu Page',
capability: 'manage_options',
menu_slug: 'custom_menu_page',
icon_url: 'fa-solid fa-thumbs-up',
);

Custom Post Type UI plugin
To use a Font Awesome icon with the Custom Post Type UI plugin, use a Font Awesome class string for the Menu Icon field when adding or editing a Post Type
Caveats
FA WP Admin Menu Icons only supports Font Awesome’s free icons

延伸相關外掛

文章
Filter
Apply Filters
Mastodon