Blockseasy_svg_core_icon()

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

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

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

body
$markupstring

Sanitized, hardened icon markup.

Return value

returnarray{content:string, classes:string[], lost:string[]}

Rewritten markup and report.