wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_register_icon › WordPress Function

Seit7.1.0
Veraltetn/v
wp_register_icon ( $icon_name, $args )
Parameter: (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.
    Erforderlich: Ja
  • (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. }
    Erforderlich: Ja
Gibt zurück:
  • (bool) True if the icon was registered successfully, else false.
Definiert in:
Codex:

Registers a new icon.



Quellcode

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