wp-includes/class-wp-icon-collections-registry.php:18Core class used for interacting with registered icon collections.
$registered_collectionsarray[]protected$instanceWP_Icon_Collections_Registry|nullprotected staticclass WP_Icon_Collections_Registry { /** * Registered icon collections array. * * @since 7.1.0 * @var array[] */ protected $registered_collections = array(); /** * Container for the main instance of the class. * * @since 7.1.0 * @var WP_Icon_Collections_Registry|null */ protected static $instance = null; /** * Registers an icon collection. * * @since 7.1.0 * * @param string $collection_slug Icon collection slug. * @param array $collection_properties { * List of properties for the icon collection. * * @type string $label Required. A human-readable label for the icon collection. * @type string $description Optional. A human-readable description for the icon collection. * } * @return bool True if the collection was registered successfully, false otherwise. */ public function register( $collection_slug, $collection_properties ) { if ( ! isset( $collection_slug ) || ! is_string( $collection_slug ) ) { _doing_it_wrong( __METHOD__, __( 'Icon collection slug must be a string.' ), '7.1.0' ); return false; } if ( ! preg_match( '/^[a-z0-9]([a-z0-9_-]*[a-z0-9])?$/', $collection_slug ) ) { _doing_it_wrong( __METHOD__, __( 'Icon collection slug must start and end with a lowercase letter or digit and contain only lowercase letters, digits, hyphens, and underscores.' ), '7.1.0' ); return false; } if ( $this->is_registered( $collection_slug ) ) { _doing_it_wrong( __METHOD__, __( 'Icon collection is already registered.' ), '7.1.0' ); return false; } if ( ! is_array( $collection_properties ) ) { _doing_it_wrong( __METHOD__, __( 'Icon collection properties must be an array.' ), '7.1.0' ); return false; } $allowed_keys = array_fill_keys( array( 'label', 'description' ), 1 ); foreach ( array_keys( $collection_properties ) as $key ) { if ( ! array_key_exists( $key, $allowed_keys ) ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: %s: The name of a user-provided key. */ __( 'Invalid icon collection property: "%s".' ), $key ), '7.1.0'Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
src/wp-includes/class-wp-icon-collections-registry.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.