Font Awesome

Inactive

allow users to select icon from font awesome.

Get Extension

Installs

100k+

Rating

4.9 / 5

Version

5.0.2

Tested to

WP 6.9.4

Install Trends

Chart renders here (client-side)

Description

Add a Font Awesome icon field type to Advanced Custom Fields.

  • Specify which FontAwesome icon sets to use (Solid, Regular, Light, Thin, Duotone, Duotone Sharp, Brands, and Custom Upload Icons) (Some features only available with FontAwesome 5.x or 6.x icons)
  • Create your own custom filtered list of FontAwesome icons to use with your fields. Use different custom icon sets with different fields
  • Returns Icon Element, Icon Class, Icon Unicode, or an Object including the element, class, unicode value, and SVG data (if applicable)
  • Optionally enqueues Font Awesome in footer where needed (when a FontAwesome field is being used on the page))
  • Integrates with the FontAwesome GraphQL for loading your FontAwesome Kits, searching for icons, and loading the latest version of FontAwesome

Note: It is recommended to let this plugin enqueue the latest version of Font Awesome on your front-end; or include the latest version yourself using your FontAwesome Kit; so that available icons in the admin area will be displayed properly on your sites front-end.

Compatibility

This ACF field type is compatible with:
* ACF 5.7+
* FontAwesome 4.x, 5.x, 6.x and 7.x fonts

Optional Configuration

Filters

  • ACFFA_always_enqueue_fa: Return true to always enqueue FontAwesome on the frontend, even if no ACF FontAwesome fields are in use on the page. This will enqueue FontAwesome in the header instead of the footer.
  • ACFFA_admin_enqueue_fa: Return false to stop enqueueing FontAwesome in the admin area. Useful if you already have FontAwesome enqueued by some other means.
  • ACFFA_get_icons: (Applies to FontAwesome 4.x and 5.x icons only) Filter the array of icons and icon details loaded from the database
  • ACFFA_get_fa_url: Filter the URL used for enqueuing FontAwesome in the frontend and admin areas of the site.
  • ACFFA_override_major_version: Filter to manually set the ‘major’ version of FontAwesome to load (accepts either 4, 5, or 6). NOTE: This filter must be registered before any calls to ACF get_field() function are made.
  • ACFFA_fa_api_key: Filter to programmatically set the FontAwesome API key.
  • ACFFA_fa_kit_token: Filter to programmatically set the FontAwesome kit token.

Installation

Typical Installation:

  1. Copy the advanced-custom-fields-font-awesome folder into your wp-content/plugins folder
  2. Activate the Font Awesome plugin via the plugins admin page
  3. Create a new field via ACF and select the Font Awesome type

Theme Installation:

If you are a theme author who wants to bundle this plugin with your theme, starting in version 4.0.1 this plugin has been designed to work from within a theme directory.

It is still more ideal to use something like TGM Plugin Activation to include required/recommended plugins with your theme. However if you choose to bundle this plugin please follow these instructions:

  1. Copy the ‘advanced-custom-fields-font-awesome’ folder into your theme folder. Preferably into a path like ‘includes/advanced-custom-fields-font-awesome’
  2. Include the plugin from your theme functions.php. Example: include_once( get_stylesheet_directory() . '/includes/advanced-custom-fields-font-awesome/acf-font-awesome.php' );

Plugins included this way are not able to receive regular plugin updates. It is up to theme developer to instead release these plugin updates to their users.

However this plugin does attempt to let the user know if they are on an out of date version of the plugin. Out of date theme installations show an admin notification message at the top of the WordPress admin plugins page. The message is as follows:

There is a new version of Advanced Custom Fields: Font Awesome available. Installed Version: {current_version}, Latest Version: {latest_version}

It looks like this plugin is bundled with your theme: ({theme_name}) and is not able to receive updates. It is recommended that you contact your theme author for updates. Alternatively you can install this plugin through the WordPress Plugin Repository to get the latest version.

If the user installs this plugin from the plugin repository, that version of the plugin will override the one installed in their theme directory.

This notification message is filterable so you can customize it to better represent how you handle plugin updates for your theme users. See example below:

function my_acffa_update_message( $out_of_date_message, $current_version, $latest_version ) {
    // Customize the message here
    return $out_of_date_message;
}
add_filter( 'ACFFA_theme_install_update_message', 'my_acffa_update_message', 10, 3 );