PHP code example of agence-adeliom / acf-icon-field
1. Go to this page and download the library: Download agence-adeliom/acf-icon-field library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
add_filter( 'acf/icon_field/register_font-awesome', function( $register ) {
$register = "free"; // (default) To enable Font Awesome Free
$register = "pro"; // To enable Font Awesome Pro via an SVG Sprite sheet
$register = false; // To disable Font Awesome
return $register;
}, 10, 1 );
add_filter( 'acf/icon_field/registry', function( \ACF_icon_registry $registry ) {
$library = new \ACF_icon_library("Lorem", "lo");
...
$registry->addLibrary($library); // To add a new library
$registry->removeLibrary('fa'); // To remove a library
$registry->getLibraries(); // Get all libraries
$registry->getLibrary(); // Get one library
return $registry;
}, 10, 1 );