';
$html .= apply_filters('sharemypost_share_bar_before_buttons', '', $post_id, $is_floating, $settings, $type);
$html .= '
';
// Share Buttons
foreach($buttons as $btn){
$btn_classes = ['sharemypost-share-button', 'sharemypost-network-' . esc_attr($btn['network'])];
$btn_classes = apply_filters('sharemypost_share_bar_button_classes', $btn_classes, $btn, $post_id, $is_floating, $settings);
$html .= '
';
if(!empty($show_icon)){
static $allowed_svg = null;
if(null === $allowed_svg){
$allowed_svg = [
'svg' => [
'viewbox' => true,
'viewBox' => true,
'xmlns' => true,
'fill' => true,
'stroke' => true,
'stroke-width' => true,
'stroke-linecap' => true,
'stroke-linejoin' => true,
'style' => true,
'class' => true,
'role' => true,
],
'path' => [
'd' => true,
'fill' => true,
'stroke' => true,
'stroke-width' => true,
'stroke-linecap' => true,
'stroke-linejoin' => true,
'style' => true,
],
'circle' => [
'cx' => true,
'cy' => true,
'r' => true,
'fill' => true,
'stroke' => true,
],
'rect' => [
'x' => true,
'y' => true,
'width' => true,
'height' => true,
'rx' => true,
'ry' => true,
'fill' => true,
],
'g' => ['fill' => true, 'stroke' => true],
'polygon' => ['points' => true, 'fill' => true],
'line' => ['x1' => true, 'y1' => true, 'x2' => true, 'y2' => true, 'stroke' => true],
'polyline' => ['points' => true, 'fill' => true, 'stroke' => true],
'ellipse' => ['cx' => true, 'cy' => true, 'rx' => true, 'ry' => true, 'fill' => true, 'stroke' => true],
'title' => [],
];
}
$html .= ''
. wp_kses($btn['icon'], $allowed_svg) .
'';
}
if(!empty($show_label)){
$html .= ''
. esc_html($btn['label']) .
'';
}
$html = apply_filters('sharemypost_share_bar_button_inner', $html, $btn, $post_id, $is_floating, $settings);
$html .= '';
}
$html .= apply_filters('sharemypost_share_bar_extra_buttons', '', $post_id, $is_floating, $settings, $show_icon, $show_label);
$html .= '
';
$html .= apply_filters('sharemypost_share_bar_after_buttons', '', $post_id, $is_floating, $settings, $type);
$html .= '
';
return wp_kses(apply_filters('sharemypost_share_bar_html', $html, $post_id, $is_floating, $settings), self::get_allowed_html_tags());
}
static function get_allowed_html_tags() {
return [
'div' => [
'class' => true,
'style' => true,
'id' => true,
],
'p' => [
'class' => true,
],
'span' => [
'class' => true,
'style' => true,
],
'a' => [
'href' => true,
'class' => true,
'target' => true,
'rel' => true,
'data-post-id' => true,
'data-network' => true,
'data-click-id' => true,
'style' => true,
],
'svg' => [
'viewbox' => true,
'viewBox' => true,
'xmlns' => true,
'fill' => true,
'stroke' => true,
'stroke-width' => true,
'stroke-linecap' => true,
'stroke-linejoin' => true,
'style' => true,
'class' => true,
'role' => true,
'width' => true,
'height' => true,
],
'path' => [
'd' => true,
'fill' => true,
'stroke' => true,
'stroke-width' => true,
'stroke-linecap' => true,
'stroke-linejoin' => true,
'style' => true,
],
'circle' => [
'cx' => true,
'cy' => true,
'r' => true,
'fill' => true,
'stroke' => true,
],
'rect' => [
'x' => true,
'y' => true,
'width' => true,
'height' => true,
'rx' => true,
'ry' => true,
'fill' => true,
],
'g' => [
'fill' => true,
'stroke' => true,
],
'polygon' => [
'points' => true,
'fill' => true,
],
'line' => [
'x1' => true,
'y1' => true,
'x2' => true,
'y2' => true,
'stroke' => true,
],
'polyline' => [
'points' => true,
'fill' => true,
'stroke' => true,
],
'ellipse' => [
'cx' => true,
'cy' => true,
'rx' => true,
'ry' => true,
'fill' => true,
'stroke' => true,
],
'title' => [],
];
}
}