Make WordPress Core


Ignore:
Timestamp:
07/14/2026 03:16:39 PM (2 months ago)
Author:
wildworks
Message:

Icons: Add wp_get_icon() to render registered icons.

Introduce wp_get_icon(), a procedural wrapper around WP_Icons_Registry that returns a registered icon as an inline SVG string. It accepts size to set the width and height, class to append CSS class names, and label to provide an accessible name.

Developed in: https://github.com/WordPress/wordpress-develop/pull/12010

Props jonsurrell, mcsf, mukesh27, tyxla, wildworks.
See #64847.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r62668 r62736  
    301301require ABSPATH . WPINC . '/connectors.php';
    302302require ABSPATH . WPINC . '/class-wp-icons-registry.php';
     303require ABSPATH . WPINC . '/icons.php';
    303304require ABSPATH . WPINC . '/widgets.php';
    304305require ABSPATH . WPINC . '/class-wp-widget.php';
Note: See TracChangeset for help on using the changeset viewer.