Title: WP_Icons_Registry::get_instance
Published: May 20, 2026

---

# WP_Icons_Registry::get_instance(): 󠀁[WP_Icons_Registry](https://developer.wordpress.org/reference/classes/wp_icons_registry/)󠁿

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#related)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#wp--skip-link--target)

Utility method to retrieve the main instance of the class.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#description)󠁿

The instance will be created if it does not exist yet.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#return)󠁿

 [WP_Icons_Registry](https://developer.wordpress.org/reference/classes/wp_icons_registry/)
The main instance.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#source)󠁿

    ```php
    public static function get_instance() {
    	if ( null === self::$instance ) {
    		self::$instance = new self();
    	}

    	return self::$instance;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-icons-registry.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-icons-registry.php#L303)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-icons-registry.php#L303-L309)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_icons_registry/get_instance/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Icons_Registry::__construct()](https://developer.wordpress.org/reference/classes/wp_icons_registry/__construct/)`wp-includes/class-wp-icons-registry.php` |

Constructor.

  |

| Used by | Description | 
| [WP_REST_Icons_Controller::get_items()](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_items/)`wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php` |

Retrieves all icons.

  | 
| [WP_REST_Icons_Controller::get_icon()](https://developer.wordpress.org/reference/classes/wp_rest_icons_controller/get_icon/)`wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php` |

Retrieves a specific icon from the registry.

  |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_icons_registry%2Fget_instance%2F)
before being able to contribute a note or feedback.