easy_svg_core_icon()
Rewrites an icon so core's icon registry keeps it: shapes to paths, strokes to classes.
Function · Easy SVG · Status: Internal · Defined in includes/core-icon.php
Usage
easy_svg_core_icon( string $markup ): array
Example
$for_core = easy_svg_core_icon( $svg );
if ( array() !== $for_core['lost'] ) {
// Gradients, text or similar were dropped.
}
Description
Core keeps only svg, path and polygon. This flattens groups, turns circle, ellipse, rect, line and polyline into paths, removes what cannot be expressed and lists it in lost, and adds stroke classes to the root when every drawing element is unfilled and stroked. Returns content, classes and lost; content is empty when the markup does not parse.
Parameters
Sanitized, hardened icon markup.
Return value
Rewritten markup and report.