<?php

namespace FinchCart\Admin\Edith\includes;

/**
 * Escaping SVG with KSES
 *
 * @return array
 */
function edith_kses_allowed_svg() {
	$kses_defaults = wp_kses_allowed_html( 'post' );

	$svg_args = array(
		'svg'      => array(
			'class'           => true,
			'aria-hidden'     => true,
			'aria-labelledby' => true,
			'role'            => true,
			'xmlns'           => true,
			'width'           => true,
			'height'          => true,
			'viewbox'         => true,
			'fill'            => true,
			'stroke'          => true,
			'stroke-width'    => true,
			'stroke-linecap'  => true,
			'stroke-linejoin' => true,

		),
		'g'        => array( 'fill' => true ),
		'title'    => array( 'title' => true ),
		'polyline' => array( 'points' => true ),
		'path'     => array(
			'd'               => true,
			'fill'            => true,
			'stroke-width'    => true,
			'stroke-linejoin' => true,
			'stroke-linecap'  => true,
		),
		'rect'     => array(
			'x'      => true,
			'y'      => true,
			'width'  => true,
			'height' => true,
			'rx'     => true,
			'ry'     => true,
		),
	);

	$allowed_tags = array_merge( $kses_defaults, $svg_args );

	return $allowed_tags;
}
