'',
'instagram' => '',
'twitter' => '',
'x' => '',
'youtube' => '',
'tiktok' => '',
'whatsapp' => '',
'website' => '',
'phone' => '',
'email' => '',
'link' => '',
'play' => '',
'calendar' => '',
'clock' => '',
'mic' => '',
'radio' => '',
'share' => '',
'arrow' => '',
'headphone' => '',
);
if ( ! isset( $paths[ $name ] ) ) {
return '';
}
return '';
}
/**
* wp_kses() allow-list for the inline SVG icons (use when echoing svg() output).
*
* @return array>
*/
public static function kses_allowed() {
$shape = array(
'class' => true,
'fill' => true,
'fill-rule' => true,
'clip-rule' => true,
'stroke' => true,
'stroke-width' => true,
'stroke-linecap' => true,
'stroke-linejoin' => true,
'stroke-miterlimit' => true,
'opacity' => true,
'transform' => true,
);
return array(
'svg' => array(
'class' => true,
'xmlns' => true,
'viewbox' => true,
'width' => true,
'height' => true,
'fill' => true,
'stroke' => true,
'role' => true,
'aria-hidden' => true,
'aria-label' => true,
'focusable' => true,
),
'g' => $shape,
'title' => array(),
'path' => array_merge( $shape, array( 'd' => true ) ),
'circle' => array_merge(
$shape,
array(
'cx' => true,
'cy' => true,
'r' => true,
)
),
'rect' => array_merge(
$shape,
array(
'x' => true,
'y' => true,
'width' => true,
'height' => true,
'rx' => true,
'ry' => true,
)
),
'line' => array_merge(
$shape,
array(
'x1' => true,
'y1' => true,
'x2' => true,
'y2' => true,
)
),
'polyline' => array_merge( $shape, array( 'points' => true ) ),
'polygon' => array_merge( $shape, array( 'points' => true ) ),
);
}
/**
* Display label for a social network key.
*
* @param string $net Key.
* @return string
*/
public static function label( $net ) {
$labels = array(
'facebook' => 'Facebook',
'instagram' => 'Instagram',
'twitter' => 'X',
'x' => 'X',
'youtube' => 'YouTube',
'tiktok' => 'TikTok',
'whatsapp' => 'WhatsApp',
'website' => __( 'Website', 'streamsera' ),
'email' => __( 'Email', 'streamsera' ),
'phone' => __( 'Phone', 'streamsera' ),
);
return isset( $labels[ $net ] ) ? $labels[ $net ] : ucfirst( $net );
}
}