An open API service indexing awesome lists of open source software.

https://github.com/beapi/acf-svg-icon

Add svg icon selector for ACF field.
https://github.com/beapi/acf-svg-icon

acf acf-field advanced-custom-fields plugin select2 svg svg-icon-selector svg-icons wordpress wordpress-plugin

Last synced: 4 months ago
JSON representation

Add svg icon selector for ACF field.

Awesome Lists containing this project

README

          

# Advanced Custom Fields: SVG Icon #

This enhance [Advanced Custom Field](https://www.advancedcustomfields.com/pro/) plugin by adding a custom field.

This ACF field is a select2 field in order to include your great fonts. It will allow you to select icons and then return the corresponding class icon.

## Compatibility

This ACF field type is compatible with:
* ACF 5.0.0 and up, that means the pro version.
* ACF 4 (not supported).

## Installation

### via Composer

1. Add a line to your repositories array: `{ "type": "git", "url": "https://github.com/BeAPI/acf-svg-icon" }`
2. Add a line to your require block: `"bea/acf-svg-icon": "dev-master"`
3. Run: `composer update`

### Manual

1. Copy the plugin folder into your plugins folder.
2. Activate the plugin via the plugins admin page.
3. Create a new field via ACF and select the SVG Icon selector.

## How to ##

### Upload SVG into library

You can upload media in your library, it must be an SVG, and then it will be displayed into the SVG dropdown.
In this case, consider using [Scalable Vector Graphics (svg)](https://fr.wordpress.org/plugins/scalable-vector-graphics-svg) for security.

### In your own theme ###

To load several SVGs from your theme (development), use the following filter to add the main sprite SVG file :

```php
version property undefined on ACF versions under 5.6
* use built-in wrapper acf_get_setting('version') to retrieve version

### 1.2.0 - 27 July 2017
* Add compatibility for ACF 5.6.0 and more versions
* Still keep compatibility for ACF 5.6.0 and lower versions
* Add some custom CSS for a more beautiful admin UI
* Now displaying the icon name, not anymore like a slug
* Improve readme

### 1.0.1 - 11 May 2017
* Initial