getBadges();
if ( empty( $badges ) ) {
return;
}
?>
getIconSvg( (string) $badge['icon'] ), $this->svgAllowedTags() ); ?>
'lock', 'text' => __( 'HTTPS Checkout', 'arrayfunnel' ) ],
[ 'icon' => 'shield', 'text' => __( 'Encrypted Connection', 'arrayfunnel' ) ],
] );
}
private function getIconSvg( string $icon ): string {
$icons = [
'lock' => '',
'shield' => '',
'return' => '',
'star' => '',
];
return isset( $icons[ $icon ] ) ? $icons[ $icon ] : $icons['lock'];
}
private function svgAllowedTags(): array {
return [
'svg' => [
'xmlns' => true,
'viewbox' => true,
'fill' => true,
'stroke' => true,
'stroke-width' => true,
'stroke-linecap' => true,
'stroke-linejoin' => true,
'aria-hidden' => true,
'focusable' => true,
],
'path' => [ 'd' => true ],
'rect' => [ 'x' => true, 'y' => true, 'width' => true, 'height' => true, 'rx' => true, 'ry' => true ],
'polyline' => [ 'points' => true ],
'polygon' => [ 'points' => true ],
];
}
}