Iconseasy_svg_icon_slug()

easy_svg_icon_slug()

Turns a label into a slug core accepts, or an empty string.

Function · Easy SVG · Status: Internal · Defined in includes/icons.php

Internal: not part of the promised public surface. It may change without notice.

Usage

easy_svg_icon_slug( string $label, ?callable $sanitize = null ): string

Example

$slug = easy_svg_icon_slug( 'Arrow Right' ); // arrow-right

Description

Uses sanitize_title by default, lower-cases the result and checks it against EASY_SVG_ICON_NAME_PATTERN.

Parameters

body
$labelstring

Human label.

Return value

returnstring

Valid slug or an empty string.