Retrieves a specific icon collection from the registry.
Parameters
$slugstringrequired- Icon collection slug.
Source
public function get_icon_collection( $slug ) {
$registry = WP_Icon_Collections_Registry::get_instance();
$collection = $registry->get_registered( $slug );
if ( null === $collection ) {
return new WP_Error(
'rest_icon_collection_not_found',
sprintf(
/* translators: %s: Icon collection slug. */
__( 'Icon collection not found: "%s".' ),
$slug
),
array( 'status' => 404 )
);
}
return $collection;
}
Changelog
| Version | Description |
|---|---|
| 7.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.