Shortcode for Font Awesome

描述

Use [fa] to display a Font Awesome icon in posts, pages, Shortcode blocks, classic menu titles, and Text, Custom HTML or Shortcode block widgets.

Font Awesome must already be loaded by your theme or another plugin. This plugin does not include or download icon files and does not add an editor button. Available icons, styles and sizes depend on your Font Awesome installation. Font Awesome 5, 6 and 7 class syntax is supported.

Example: [fa set="fas" icon="check" size="2x" color="#000000"]

  • set: style/family classes; defaults to fas. Multiple classes are allowed, for example fa-classic fa-solid for Font Awesome 6/7.
  • icon: icon name without the fa- prefix; defaults to check.
  • size: optional size without the fa- prefix, for example sm, lg, 2x, 3x, 5x, 7x or 9x.
  • color: optional three- or six-digit hex color (#abc, #aabbcc) or RGB (rgb(12, 34, 255)). RGB channels must be integers from 0 to 255. Other color formats and additional CSS declarations are ignored.
  • label: optional accessible text for a meaningful standalone icon, for example [fa icon="check" label="Completed"]. Without a label, the icon is decorative. Links and buttons that contain only an icon still need an accessible name on the link or button itself.

Empty or invalid set/icon values use the defaults. Invalid sizes are omitted. Class values accept letters, digits, underscores and hyphens; each set class must start with a letter. Use [[fa]] to display the shortcode as text.

The additional menu and Custom HTML widget handling processes only [fa] in text, not other shortcodes or HTML attributes. Navigation blocks and custom menu walkers may require their own shortcode support. Avoid another plugin registering the same [fa] shortcode.

安裝

  1. Ensure WordPress 6.8 or newer and PHP 8.2 or newer are available.
  2. Install the plugin ZIP through Plugins > Add New > Upload Plugin, or upload the shortcode-for-font-awesome folder to /wp-content/plugins/.
  3. Activate the plugin through the Plugins menu.
  4. Ensure Font Awesome is loaded by your theme or another plugin, then insert a shortcode in a supported location.

評價

2019年5月15日 1 reply
Yeah, Nup, does not work on my site
閱讀全部2個評價

貢獻者及開發者

“Shortcode for Font Awesome” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

Shortcode for Font Awesome 外掛目前已有 1 個本地化語言版本。 感謝所有譯者為這個外掛做出的貢獻。

將 Shortcode for Font Awesome 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

2.0.0

  • Improve validation of color and icon settings and handling in menus and widgets.
  • Add optional accessible labels for icons.
  • Raise minimum requirements to WordPress 6.8 and PHP 8.2.
  • Tested with WordPress 7.1 and updated documentation.

1.4.6

  • Tested with the latest WordPress version

1.4.5

  • There were problems with the update, so an adjustment was made again
  • Code optimized

1.4.4

  • Description revised once again

1.4.3

  • Description adapted

1.4.2

  • Fixed an Error during the Generation of the Color Code

1.4.1

  • The Security of the Plugin was improved

1.4

  • The Security of the Plugin was improved

1.3.1

  • Filter integrated to use Shortcodes in Text Widgets

1.3

  • Filter integrated to use Shortcode also in Navigation Menus

1.2

  • Stable Tag inserted in readme.txt
  • Requires PHP Tag inserted in readme.txt
  • Comments integrated in PHP source code

1.1

  • Function to set the Size integrated
  • Function to set the Color integrated

1.0

  • Font Awesome Files are not integrated, these must already be loaded in WordPress