@@ -16,14 +16,15 @@ class WP_Icons_Registry {
1616 /**
1717 * Registered icons array.
1818 *
19+ * @since 7.0.0
1920 * @var array[]
2021 */
2122 protected $ registered_icons = array ();
2223
23-
2424 /**
2525 * Container for the main instance of the class.
2626 *
27+ * @since 7.0.0
2728 * @var WP_Icons_Registry|null
2829 */
2930 protected static $ instance = null ;
@@ -39,6 +40,8 @@ class WP_Icons_Registry {
3940 * These icons are defined in @wordpress/packages (Gutenberg repository) as
4041 * SVG files and as entries in a single manifest file. On init, the
4142 * registry is loaded with those icons listed in the manifest.
43+ *
44+ * @since 7.0.0
4245 */
4346 protected function __construct () {
4447 $ icons_directory = __DIR__ . '/images/icon-library/ ' ;
@@ -88,6 +91,8 @@ protected function __construct() {
8891 /**
8992 * Registers an icon.
9093 *
94+ * @since 7.0.0
95+ *
9196 * @param string $icon_name Icon name including namespace.
9297 * @param array $icon_properties {
9398 * List of properties for the icon.
@@ -184,6 +189,8 @@ protected function register( $icon_name, $icon_properties ) {
184189 * Logic borrowed from twentytwenty.
185190 * @see twentytwenty_get_theme_svg
186191 *
192+ * @since 7.0.0
193+ *
187194 * @param string $icon_content The icon SVG content to sanitize.
188195 * @return string The sanitized icon SVG content.
189196 */
@@ -219,6 +226,8 @@ protected function sanitize_icon_content( $icon_content ) {
219226 /**
220227 * Retrieves the content of a registered icon.
221228 *
229+ * @since 7.0.0
230+ *
222231 * @param string $icon_name Icon name including namespace.
223232 * @return string|null The content of the icon, if found.
224233 */
@@ -245,6 +254,7 @@ protected function get_content( $icon_name ) {
245254 /**
246255 * Retrieves an array containing the properties of a registered icon.
247256 *
257+ * @since 7.0.0
248258 *
249259 * @param string $icon_name Icon name including namespace.
250260 * @return array|null Registered icon properties or `null` if the icon is not registered.
@@ -263,6 +273,8 @@ public function get_registered_icon( $icon_name ) {
263273 /**
264274 * Retrieves all registered icons.
265275 *
276+ * @since 7.0.0
277+ *
266278 * @param string $search Optional. Search term by which to filter the icons.
267279 * @return array[] Array of arrays containing the registered icon properties.
268280 */
@@ -284,6 +296,7 @@ public function get_registered_icons( $search = '' ) {
284296 /**
285297 * Checks if an icon is registered.
286298 *
299+ * @since 7.0.0
287300 *
288301 * @param string $icon_name Icon name including namespace.
289302 * @return bool True if the icon is registered, false otherwise.
@@ -297,6 +310,7 @@ public function is_registered( $icon_name ) {
297310 *
298311 * The instance will be created if it does not exist yet.
299312 *
313+ * @since 7.0.0
300314 *
301315 * @return WP_Icons_Registry The main instance.
302316 */
0 commit comments