wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_register_icon › WordPress Function

Since7.1.0
Deprecatedn/a
wp_register_icon ( $icon_name, $args )
Parameters: (2)
  • (string) $icon_name 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.
    Required: Yes
  • (array) $args { List of properties for the icon. @type string $label Required. A human-readable label for the icon. @type string $content Optional. SVG markup for the icon. If not provided, the content will be retrieved from the `file_path` if set. If both `content` and `file_path` are not set, the icon will not be registered. @type string $file_path Optional. The full path to the file containing the icon content. }
    Required: Yes
Returns:
  • (bool) True if the icon was registered successfully, else false.
Defined at:
Codex:

Registers a new icon.



Source

function wp_register_icon( $icon_name, $args ) {
	return WP_Icons_Registry::get_instance()->register( $icon_name, $args );
}