{"id":13401355,"url":"https://github.com/htmlburger/carbon-field-icon","last_synced_at":"2025-06-19T02:05:18.417Z","repository":{"id":56986473,"uuid":"99100878","full_name":"htmlburger/carbon-field-icon","owner":"htmlburger","description":"Icon Field for the WordPress Carbon Fields library ✨","archived":false,"fork":false,"pushed_at":"2023-11-07T20:38:12.000Z","size":291,"stargazers_count":19,"open_issues_count":9,"forks_count":14,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-27T07:46:49.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/htmlburger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-08-02T09:54:19.000Z","updated_at":"2023-11-25T13:28:18.000Z","dependencies_parsed_at":"2024-01-14T18:21:38.266Z","dependency_job_id":"8349dc0e-a859-4f8d-b2ef-60870a6f0bc9","html_url":"https://github.com/htmlburger/carbon-field-icon","commit_stats":{"total_commits":58,"total_committers":5,"mean_commits":11.6,"dds":0.4137931034482759,"last_synced_commit":"fe0341462e8c8681bb7ff20380974022578e15b0"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/htmlburger/carbon-field-icon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htmlburger%2Fcarbon-field-icon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htmlburger%2Fcarbon-field-icon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htmlburger%2Fcarbon-field-icon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htmlburger%2Fcarbon-field-icon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/htmlburger","download_url":"https://codeload.github.com/htmlburger/carbon-field-icon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htmlburger%2Fcarbon-field-icon/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260669571,"owners_count":23044299,"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":[],"created_at":"2024-07-30T19:01:01.881Z","updated_at":"2025-06-19T02:05:13.402Z","avatar_url":"https://github.com/htmlburger.png","language":"JavaScript","funding_links":[],"categories":["Fields (Carbon Fields 2+)","Fields"],"sub_categories":[],"readme":"# Carbon Field Icon\n\n[![Packagist](https://img.shields.io/packagist/vpre/htmlburger/carbon-field-icon.svg?style=flat-square\u0026colorB=0366d6)](https://packagist.org/packages/htmlburger/carbon-field-icon)\n\nProvides the ability to select an icon or a glyph.\n\n## Supported glyphs\n\n- Font Awesome (v5.8.1)\n- Dashicons\n- Custom\n\n## Usage\n\nFont Awesome only (default):\n\n```php\nField::make( 'icon', 'social_site_icon', __( 'Icon', 'crb' ) ),\n```\n\nDashicons only:\n\n```php\nField::make( 'icon', 'social_site_icon', __( 'Icon', 'crb' ) )\n\t-\u003eadd_dashicons_options(),\n```\n\nDashicons and Font Awesome:\n\n```php\nField::make( 'icon', 'social_site_icon', __( 'Icon', 'crb' ) )\n\t-\u003eadd_dashicons_options()\n\t-\u003eadd_fontawesome_options(),\n```\n\nCustom icon list:\n\n```php\nField::make( 'icon', 'social_site_icon', __( 'Icon', 'crb' ) )\n\t-\u003eset_options( array(\n\t\t// Minimal settings:\n\t\t'my-custom-icon-1' =\u003e array(\n\t\t\t'name' =\u003e __( 'My Custom Icon 1' ),\n\t\t\t'icon' =\u003e get_template_directory() . '/icons/my-custom-icon-1.svg',\n\t\t),\n\n\t\t// Full settings:\n\t\t'my-custom-icon-2' =\u003e array(\n\t\t\t'name'         =\u003e __( 'My Custom Icon 2' ),\n\t\t\t'icon'         =\u003e get_template_directory() . '/icons/my-custom-icon-2.svg',\n\t\t\t'id'           =\u003e 'my-custom-icon-2',\n\t\t\t'class'        =\u003e 'my-custom-prefix-class',\n\t\t\t'search_terms' =\u003e array( 'shop', 'checkout', 'product' ),\n\t\t),\n\t) ),\n```\n\nCustom icon list (using providers):\n\n```php\nclass Custom_Icon_Provider implements Carbon_Field_Icon\\Providers\\Icon_Provider_Interface {\n\tpublic function parse_options() {\n\t\treturn array(\n\t\t\t// Minimal settings:\n\t\t\t'custom-icon-1' =\u003e array(\n\t\t\t\t'name' =\u003e __( 'Custom Icon 1' ),\n\t\t\t\t'icon' =\u003e get_template_directory() . '/icons/custom-icon-1.svg',\n\t\t\t),\n\n\t\t\t// Full settings:\n\t\t\t'custom-icon-2' =\u003e array(\n\t\t\t\t'name'         =\u003e __( 'Custom Icon 2' ),\n\t\t\t\t'icon'         =\u003e get_template_directory() . '/icons/custom-icon-2.svg',\n\t\t\t\t'id'           =\u003e 'custom-icon-2',\n\t\t\t\t'class'        =\u003e 'custom-prefix-class',\n\t\t\t\t'search_terms' =\u003e array( 'shop', 'checkout', 'product' ),\n\t\t\t),\n\t\t);\n\t}\n}\n\nadd_action( 'carbon_fields_icon_field_loaded', 'crb_register_custom_icon_field_provider' );\nfunction crb_register_custom_icon_field_provider() {\n\t$provider_id = 'custom';\n\n\t\\Carbon_Fields\\Carbon_Fields::instance()-\u003eioc['icon_field_providers'][ $provider_id ] = function( $container ) {\n\t\treturn new Custom_Icon_Provider();\n\t};\n\n\t\\Carbon_Field_Icon\\Icon_Field::add_provider( [ $provider_id ] );\n}\n\nContainer::make( 'theme_options', __( 'Theme Options', 'crb' ) )\n\t-\u003eset_page_file( 'crbn-theme-options.php' )\n\t-\u003eadd_fields( array(\n\t\tField::make( 'icon', 'crb_custom_icon', __( 'Choose Custom Icon', 'crb' ) )\n\t\t\t-\u003eadd_provider_options( 'custom' ),\n\t) );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtmlburger%2Fcarbon-field-icon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhtmlburger%2Fcarbon-field-icon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtmlburger%2Fcarbon-field-icon/lists"}