Skip to content

A custom field type for Advanced Custom Fields (ACF) that adds a Feather Icon picker. This field allows you to easily select from the complete collection of Feather Icons https://feathericons.com in your WordPress admin.

Notifications You must be signed in to change notification settings

rhuan-dev/acf-feather-icons-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACF Feather Icon Field

A custom field type for Advanced Custom Fields (ACF) Pro that adds a Feather Icon picker. This field allows you to easily select from the complete collection of Feather Icons in your WordPress admin.

Features

  • Beautiful and user-friendly icon picker interface
  • Search functionality to quickly find icons
  • Category filtering to browse icons by type
  • Returns either HTML markup or icon class name
  • Fully responsive design
  • Compatible with the latest WordPress and ACF Pro versions
  • Translations available (currently: English, Brazilian Portuguese)

Requirements

  • WordPress 5.0 or later
  • Advanced Custom Fields PRO 5.0.0 or later
  • PHP 7.0 or later

Installation

  1. Download the plugin
  2. Upload the plugin files to the /wp-content/plugins/acf-feather-icon-field directory
  3. Activate the plugin through the 'Plugins' screen in WordPress
  4. The field type will now be available in ACF field group settings as "Feather Icon"

Usage

  1. Create a new field group in ACF
  2. Add a new field and select "Feather Icon" as the field type
  3. Configure the field settings:
    • Return Format: Choose between "Icon HTML" or "Icon Class"
    • Icon HTML returns: <i data-feather="icon-name"></i>
    • Icon Class returns: feather-icon-name

Using the Icon in Your Theme

When using the "Icon HTML" return format, make sure to include the Feather Icons JavaScript in your theme:

<script src="https://unpkg.com/feather-icons"></script>
<script>
  feather.replace();
</script>

Example Usage in PHP

<?php
// Get the icon
$icon = get_field('your_field_name');

if ($icon) {
    // If return format is "Icon HTML"
    echo $icon;
    
    // If return format is "Icon Class"
    echo '<i class="' . esc_attr($icon) . '"></i>';
}
?>

Translations

The plugin comes with the following translations:

  • English (default)
  • Brazilian Portuguese (pt_BR)

To add a new translation:

  1. Copy the languages/acf-feather-icon.pot file
  2. Rename it to acf-feather-icon-{locale}.po (e.g., acf-feather-icon-fr_FR.po for French)
  3. Translate the strings in the file
  4. Generate the .mo file using a tool like Poedit or WP-CLI

License

This project is licensed under the GPL v2 or later - see the LICENSE file for details.

Credits

Author

Created by Rhuan Carlos

About

A custom field type for Advanced Custom Fields (ACF) that adds a Feather Icon picker. This field allows you to easily select from the complete collection of Feather Icons https://feathericons.com in your WordPress admin.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published