pfeifferNet

Icons
in package

Provides SVG icon support.

Provides inline SVG icons.

Tags
since
5.5.0
since
5.11.0

Deprecate global singleton.

since
6.3.0

Use common asset functions.

used-by
Links::__construct()
used-by
Messages::__construct()
used-by
Social::__construct()

Table of Contents

Constants

SVG_KSES_RULES  = array('svg' => array('aria-hidden' => true, 'aria-labelledby' => true, 'class' => true, 'fill' => true, 'focusable' => true, 'height' => true, 'preserveaspectratio' => true, 'role' => true, 'viewbox' => true, 'width' => true, 'xmlns' => true), 'circle' => array('cx' => true, 'cy' => true, 'fill' => true, 'r' => true), 'clipPath' => array('id' => true), 'defs' => array('id' => true), 'g' => array('fill' => true, 'clip-path' => true, 'mask' => true, 'transform' => true), 'line' => array('fill-rule' => true, 'fill' => true, 'stroke-width' => true, 'stroke' => true, 'transform' => true, 'x1' => true, 'x2' => true, 'y1' => true, 'y2' => true), 'mask' => array('fill' => true, 'height' => true, 'id' => true, 'maskUnits' => true, 'style' => true, 'width' => true, 'x' => true, 'y' => true), 'path' => array('clip-rule' => true, 'd' => true, 'fill-rule' => true, 'fill' => true), 'polygon' => array('fill-rule' => true, 'fill' => true, 'focusable' => true, 'points' => true, 'transform' => true), 'rect' => array('fill-rule' => true, 'fill' => true, 'height' => true, 'width' => true, 'x' => true, 'y' => true), 'symbol' => array('id' => true, 'viewbox' => true), 'use' => array('href' => true))
KSES ruleset to apply to SVG elements.

Properties

$instances  : array<string|int, object>
The array of instances of this class and sub-classes.

Methods

get_icon()  : string
Get the SVG icon.
get_instance()  : object
Creates and/or returns the instance of this class.
get_kses_rules()  : array<string|int, mixed>
Return the allowed HTML for wp_kses rules.
get_path()  : string
Get the path to the icons folder.
get_url()  : string
Get the url of the icons folder.
__construct()  : void
Initialise the class.

Constants

SVG_KSES_RULES

KSES ruleset to apply to SVG elements.

protected array<string|int, mixed> SVG_KSES_RULES = array('svg' => array('aria-hidden' => true, 'aria-labelledby' => true, 'class' => true, 'fill' => true, 'focusable' => true, 'height' => true, 'preserveaspectratio' => true, 'role' => true, 'viewbox' => true, 'width' => true, 'xmlns' => true), 'circle' => array('cx' => true, 'cy' => true, 'fill' => true, 'r' => true), 'clipPath' => array('id' => true), 'defs' => array('id' => true), 'g' => array('fill' => true, 'clip-path' => true, 'mask' => true, 'transform' => true), 'line' => array('fill-rule' => true, 'fill' => true, 'stroke-width' => true, 'stroke' => true, 'transform' => true, 'x1' => true, 'x2' => true, 'y1' => true, 'y2' => true), 'mask' => array('fill' => true, 'height' => true, 'id' => true, 'maskUnits' => true, 'style' => true, 'width' => true, 'x' => true, 'y' => true), 'path' => array('clip-rule' => true, 'd' => true, 'fill-rule' => true, 'fill' => true), 'polygon' => array('fill-rule' => true, 'fill' => true, 'focusable' => true, 'points' => true, 'transform' => true), 'rect' => array('fill-rule' => true, 'fill' => true, 'height' => true, 'width' => true, 'x' => true, 'y' => true), 'symbol' => array('id' => true, 'viewbox' => true), 'use' => array('href' => true))
Tags
since
5.5.0
since
5.12.0

Extended rules to cover new SVG icon set.

Properties

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
5.11.0

Methods

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
Return values
object

The instance of this class.

get_kses_rules()

Return the allowed HTML for wp_kses rules.

public get_kses_rules(array<string|int, mixed> $allowed_tags, string $context) : array<string|int, mixed>
Parameters
$allowed_tags : array<string|int, mixed>

The allowed HTML tags.

$context : string

The wp_kses context.

Tags
since
5.12.0
link
https://developer.wordpress.org/reference/hooks/wp_kses_allowed_html/
Return values
array<string|int, mixed>

The settings for wp_kses to allow SVG use.

get_path()

Get the path to the icons folder.

public get_path() : string
Tags
since
5.9.0
uses
get_asset_path()
used-by
filter_icon_sources()
Return values
string

The fully qualified path to the icons folder.

get_url()

Get the url of the icons folder.

public get_url() : string
Tags
since
5.9.0
uses
get_asset_url()
used-by
filter_icon_sources()
Return values
string

The url of the icons folder.

__construct()

Initialise the class.

protected __construct() : void
Tags
since
5.5.0

        
On this page

Search results