easy_svg_accept_icon()
Decides whether submitted icon markup may be stored, and returns the cleaned version.
Function · Easy SVG · Status: Internal · Defined in includes/icons.php
Usage
easy_svg_accept_icon( string $label, string $markup, callable $sanitize, ?callable $slugger = null, int $max_bytes = 0, ?callable $too_complex = null ): array
Example
$sanitizer = easy_svg_sanitizer();
$decision = easy_svg_accept_icon( 'Heart', $svg, array( $sanitizer, 'sanitize' ), null, easy_svg_max_bytes(), 'easy_svg_svg_too_complex' );
Description
Pure, with every dependency injected. Order: slug from label (bad_name), empty markup (empty), size (too_large, 0 means unbounded), complexity (too_complex), sanitizer (not_svg on a throw or empty result), svg root present, then easy_svg_harden_icon_markup(). On ok it returns slug and content.
Parameters
Typed name.
Raw markup.
Returns cleaned markup or false.
Label to slug, default sanitize_title.
Size limit, 0 for none.
Complexity check.
Return value
ok, bad_name, empty, too_large, too_complex or not_svg.