{"id":20303710,"url":"https://github.com/serkanalgur/cmb2-field-faiconselect","last_synced_at":"2025-04-11T13:51:50.052Z","repository":{"id":57048319,"uuid":"120065429","full_name":"serkanalgur/cmb2-field-faiconselect","owner":"serkanalgur","description":"CMB2 Field Type: Font Awesome (Font Awesome Icon Selector for CMB2)","archived":false,"fork":false,"pushed_at":"2022-07-30T22:05:26.000Z","size":674,"stargazers_count":20,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T10:05:09.058Z","etag":null,"topics":["cmb2","font-awesome","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://wordpress.org/plugins/cmb2-field-type-font-awesome/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serkanalgur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"https://www.paypal.me/serkanalgur"}},"created_at":"2018-02-03T06:20:49.000Z","updated_at":"2022-07-30T22:05:29.000Z","dependencies_parsed_at":"2022-08-23T19:10:23.680Z","dependency_job_id":null,"html_url":"https://github.com/serkanalgur/cmb2-field-faiconselect","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanalgur%2Fcmb2-field-faiconselect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanalgur%2Fcmb2-field-faiconselect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanalgur%2Fcmb2-field-faiconselect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkanalgur%2Fcmb2-field-faiconselect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serkanalgur","download_url":"https://codeload.github.com/serkanalgur/cmb2-field-faiconselect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247934828,"owners_count":21020728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmb2","font-awesome","wordpress","wordpress-plugin"],"created_at":"2024-11-14T16:40:22.761Z","updated_at":"2025-04-11T13:51:50.032Z","avatar_url":"https://github.com/serkanalgur.png","language":"PHP","funding_links":["https://www.paypal.me/serkanalgur","https://paypal.me/serkanalgur"],"categories":[],"sub_categories":[],"readme":"# CMB2 Field Type: Font Awesome\n#### Font Awesome Icon Selector for CMB2\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fserkanalgur%2Fcmb2-field-faiconselect.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fserkanalgur%2Fcmb2-field-faiconselect?ref=badge_shield)\n\n## Description\nFont Awesome icon selector for powerful custom metabox generator [CMB2](https://github.com/WebDevStudios/CMB2 \"Custom Metaboxes and Fields for WordPress 2\")\n\nYou can use as field type in CMB2 function file. Add a new field, set type to `faiconselect` and add font awesome icons to options (look Usage for examples). Plugin uses [jQuery Font Picker](https://codeb.it/fonticonpicker/) for creating a icon selector.\n\nPlugin capable to use Font Awesome 4.7.0 or 5.7.2 (only Solid and Brands icons) for icons and selector.\n\n### WordPress Plugin\nYou can download this plugin also here : [CMB2 Field Type: Font Awesome](https://wordpress.org/plugins/cmb2-field-type-font-awesome/)\nor you can search as `CMB2 Field Type: Font Awesome` on your plugin install page.\n\n### Install via Composer\nThis plugin available as [Composer Package](https://packagist.org/packages/serkanalgur/cmb2-field-faiconselect) and can be installed via Composer.\n\n```bash\ncomposer require serkanalgur/cmb2-field-faiconselect\n```\n### ScreenShot\n\n![Image](screenshot-1.png?raw=true)\n\n## Usage\n\nDownload this repo and put files into `wp-content/plugins/` directory. When you enable plugin, you can use field type in CMB2.\n\nAlternatively you can search `CMB2 Field Type: Font Awesome` on WordPress plugin directory.\n\nUse `faiconselect` for type. For Example;\n\n```php\n$cmb-\u003eadd_field( array(\n    'name' =\u003e __( 'Select Font Awesome Icon', 'cmb' ),\n    'id'   =\u003e $prefix . 'iconselect',\n    'desc' =\u003e 'Select Font Awesome icon',\n    'type' =\u003e 'faiconselect',\n    'options' =\u003e array(\n\t'fa fa-facebook' =\u003e 'fa fa-facebook',\n\t'fa fa-500px'  \t =\u003e 'fa fa-500px',\n\t'fa fa-twitter'\t =\u003e 'fa fa-twitter'\n    )\n) );\n  ```\n  After that jQuery Font Picker plugin handle the select.\n\n  Aslo you can use predefined array for Font Awesome. I created a function with this addon to use in `options_cb`. Function called as `returnRayFaPre`.\n\n```php\n$cmb-\u003eadd_field( array(\n    'name' =\u003e __( 'Select Font Awesome Icon', 'cmb' ),\n    'id'   =\u003e $prefix . 'iconselect',\n    'desc' =\u003e 'Select Font Awesome icon',\n    'type' =\u003e 'faiconselect',\n    'options_cb' =\u003e 'returnRayFaPre'\n) );\n```\n\n## Usage From Template Folder\n\nDownload and place folder into your theme folder. You need to create a function for fixing asset path issue. Fore example;\n\n```php\n// Fix for $asset_path issue\nfunction asset_path_faiconselect() {\n    return get_template_directory_uri() . '/path/to/folder'; //Change to correct path.\n}\n\nadd_filter( 'sa_cmb2_field_faiconselect_asset_path', 'asset_path_faiconselect' );\n\n//Now call faiconselect\nrequire get_template_directory() . '/path/to/folder/iconselect.php'; //Again Change to correct path.\n```\n\nThis function solve assetpath issue for including javascript and css files.\n\n## Usage With Font Awesome 5\n\nYou need two different options for activate Font Awesome 5. You will need to add an attribute. Also there is a function for predefined list of font-awesome :smile:\n\n#### Standart Way\n\n```php\n$cmb-\u003eadd_field( array(\n    'name' =\u003e __( 'Select Font Awesome Icon', 'cmb' ),\n    'id'   =\u003e $prefix . 'iconselect',\n    'desc' =\u003e 'Select Font Awesome icon',\n    'type' =\u003e 'faiconselect',\n    'options' =\u003e array(\n        'fab fa-facebook' =\u003e 'fa fa-facebook',\n        'fab fa-500px'  \t =\u003e 'fa fa-500px',\n        'fab fa-twitter'\t =\u003e 'fa fa-twitter',\n        'fas fa-address-book' =\u003e 'fas fa-address-book'\n    ),\n    'attributes' =\u003e array(\n        'faver' =\u003e 5\n    )\n) );\n  ```\n\nThis attribute needed for selecting right style files. If you don't add these attribute, you can not see icons.\n\n#### Predefined Way\n\n```php\n$cmb-\u003eadd_field( array(\n    'name' =\u003e __( 'Select Font Awesome Icon', 'cmb' ),\n    'id'   =\u003e $prefix . 'iconselect',\n    'desc' =\u003e 'Select Font Awesome icon',\n    'type' =\u003e 'faiconselect',\n    'options_cb' =\u003e 'returnRayFapsa',\n    'attributes' =\u003e array(\n        'faver' =\u003e 5\n    )\n) );\n  ```\n\nAs you can see we define an `options_cb` function named `returnRayFapsa`. This function create an array for options with `solid` and `brands` icons. Also you need `faver` attribute for Font Awesome 5.\n\nThat's All for now :smile: Contributions are welcome\n\nYou can donate me via;\n\nPaypal : https://paypal.me/serkanalgur\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fserkanalgur%2Fcmb2-field-faiconselect.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fserkanalgur%2Fcmb2-field-faiconselect?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkanalgur%2Fcmb2-field-faiconselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserkanalgur%2Fcmb2-field-faiconselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkanalgur%2Fcmb2-field-faiconselect/lists"}