Registers a new icon.
Parameters
$icon_namestringrequired- Namespaced icon name in the form "collection/icon-name" (e.g. "my-plugin/arrow-left"). The "core" collection is reserved for WordPress core icons; third-party code should register icons under its own collection rather than the "core" collection.
$argsarrayrequired- List of properties for the icon.
labelstringRequired. A human-readable label for the icon.contentstringOptional. SVG markup for the icon.
If not provided, the content will be retrieved from thefile_pathif set.
If bothcontentandfile_pathare not set, the icon will not be registered.file_pathstringOptional. The full path to the file containing the icon content.
Source
function wp_register_icon( $icon_name, $args ) {
return WP_Icons_Registry::get_instance()->register( $icon_name, $args );
}
Changelog
| Version | Description |
|---|---|
| 7.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.