Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jameelmoses/acf-icomoon
This adds an IcoMoon icon select field to ACF.
https://github.com/jameelmoses/acf-icomoon
advanced-custom-fields icomoon wordpress wordpress-plugin
Last synced: 3 days ago
JSON representation
This adds an IcoMoon icon select field to ACF.
- Host: GitHub
- URL: https://github.com/jameelmoses/acf-icomoon
- Owner: jameelmoses
- Created: 2017-10-24T19:13:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-22T20:12:20.000Z (about 1 year ago)
- Last Synced: 2024-08-02T19:38:15.217Z (3 months ago)
- Topics: advanced-custom-fields, icomoon, wordpress, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 138 KB
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Advanced Custom Fields: IcoMoon #
## Description ##
This adds an IcoMoon icon select field to ACF.
## Important to know ##
In case you want to include this small plugin to your project running composer you can add this line to your composer.json :
```json
"repositories": [
{
"type": "vcs",
"url": "https://github.com/jameelmoses/acf-icomoon"
}
]
```then run the command :
```shell
composer require jameelmoses/acf-icomoon
```## Tips ##
### Using this with your own font icon in your own theme ###
Font family name, font files dir path and font files URL are filterable.
```php
/**
* Update icon file css path.
*
* @return string
*/
function override_acf_icomoon_filepath() {
return get_stylesheet_directory() . '/assets/css/icons.css';
}
add_filter( 'icomoon_filepath', 'override_acf_icomoon_filepath' );/**
* Update icon file css url
*
* @return string
*/
function override_acf_icomoon_fileurl() {
return get_stylesheet_directory_uri() . '/assets/css/icons.css';
}
add_filter( 'icomoon_fileurl', 'override_acf_icomoon_fileurl' );/**
* Update icon files.
*
* @return array
*/
function override_acf_icomoon_fonts() {
return array(
'woff2' => get_stylesheet_directory_uri() . '/assets/fonts/icomoon.woff?ousyjt',
'ttf' => get_stylesheet_directory_uri() . '/assets/fonts/icomoon.ttf?ousyjt',
'woff' => get_stylesheet_directory_uri() . '/assets/fonts/icomoon.woff?ousyjt',
'svg' => get_stylesheet_directory_uri() . '/assets/fonts/icomoon.svg?ousyjt#icomoon'
);
}
add_filter( 'icomoon_fonts', 'override_acf_icomoon_fonts' );/**
* font family for theme
*/
function override_acf_icomoon_font_family() {
return 'icomoon';
}
add_filter( 'icomoon_font_family_name', 'override_acf_icomoon_font_family' );
```