| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Icons API: WP_Icons_Registry class
| File Size: | 384 lines (10 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
WP_Icons_Registry:: (9 methods):
__construct()
register()
unregister()
sanitize_icon_content()
get_content()
get_registered_icon()
get_registered_icons()
is_registered()
get_instance()
Class: WP_Icons_Registry - X-Ref
Core class used for interacting with registered icons.| __construct() X-Ref |
| Constructor. WP_Icons_Registry is a singleton class, so keep this protected. Icons are populated via `_wp_register_default_icons()` during the `init` action. Third-party icons can be registered via {@see wp_register_icon()} once their collection is registered. |
| register( $icon_name, $icon_properties ) X-Ref |
| Registers an icon. param: string $icon_name Namespaced icon name in the form "collection/icon-name" param: array $icon_properties { return: bool True if the icon was registered with success and false otherwise. |
| unregister( $icon_name ) X-Ref |
| Unregisters an icon. param: string $icon_name Namespaced icon name in the form "collection/icon-name" return: bool True if the icon was unregistered successfully, false otherwise. |
| sanitize_icon_content( $icon_content ) X-Ref |
| Sanitizes the icon SVG content. Logic borrowed from twentytwenty. param: string $icon_content The icon SVG content to sanitize. return: string The sanitized icon SVG content. |
| get_content( $icon_name ) X-Ref |
| Retrieves the content of a registered icon. param: string $icon_name Icon name including namespace. return: string|null The content of the icon, if found. |
| get_registered_icon( $icon_name ) X-Ref |
| Retrieves an array containing the properties of a registered icon. param: string $icon_name Icon name including namespace. return: array|null Registered icon properties or `null` if the icon is not registered. |
| get_registered_icons( $search = '' ) X-Ref |
| Retrieves all registered icons. param: string $search Optional. Search term by which to filter the icons. return: array[] Array of arrays containing the registered icon properties. |
| is_registered( $icon_name ) X-Ref |
| Checks if an icon is registered. param: string $icon_name Icon name including namespace. return: bool True if the icon is registered, false otherwise. |
| get_instance() X-Ref |
| Utility method to retrieve the main instance of the class. The instance will be created if it does not exist yet. return: WP_Icons_Registry The main instance. |
| Generated : Fri Jul 24 08:20:19 2026 | Cross-referenced by PHPXref |