wp-includes/class-wp-icon-collections-registry.php:50Registers an icon collection.
$collection_slugstring$collection_propertiesarray$labelstring
$descriptionstring
bool 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' ); return false; } } if ( ! isset( $collection_properties['label'] ) || ! is_string( $collection_properties['label'] ) ) { _doing_it_wrong( __METHOD__, __( 'Icon collection label must be a string.' ), '7.1.0' ); return false; } if ( isset( $collection_properties['description'] ) && ! is_string( $collection_properties['description'] ) ) { _doing_it_wrong( __METHOD__, __( 'Icon collection description must be a string.' ), '7.1.0' ); return false; } $defaults = array( 'description' => '', ); $collection = array_merge( $defaults, $collection_properties, array( 'slug' => $collection_slug ) );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.