pfeifferNet

Link_Icons extends Links
in package

Provide list of anchor link icons.

  • Uses inline SVG icons.
Tags
since
6.0.0
uses
Links
used-by
Follow_Site::set_renderer()

Table of Contents

Constants

CONTAINER_CLASSES  = array('pnet-button-container')
Additional container classes.
CONTAINER_DEFAULTS  = array('aria_label' => 'links', 'class' => '', 'classes' => array('pnet-links-list'))
Default container settings.
EXTERNAL_RELS  = array('external', 'noopener')
External link rel attributes.
ITEM_DEFAULTS  = array('class' => '', 'classes' => array(), 'new_tab' => false, 'rel' => '', 'rels' => array(), 'service' => '', 'icon' => '', 'target' => '', 'text' => '', 'title' => '', 'url' => '')
Default list item settings.
LINK_CLASSES  = array('pnet-button', 'pnet-icon-link')
Additional link item classes.
LIST_CONTAINER  = 'link-list.php'
The links container partial filename.
LIST_ITEM_CONTAINER  = 'link-icon.php'
The link item partial filename.

Properties

$container_atts  : array<string|int, mixed>
The attributes of the list container.
$icons  : Icons
The instance of the SVG icon handler.
$instances  : array<string|int, object>
The array of instances of this class and sub-classes.
$item_atts  : array<string|int, mixed>
The array of list item definition arrays.
$list_container  : string
The fully qualified path to the list container partial.
$list_item_container  : string
The fully qualified path to the list item container partial.

Methods

get_instance()  : object
Creates and/or returns the instance of this class.
render()  : void
Render the list of links.
__construct()  : void
Initialise the class and set its properties.
get_rel_atts()  : array<string|int, string>
Return the link rel attributes.
render_items()  : void
Render the link list item.
set_container_attributes()  : void
Set the link container attributes.
set_item_attributes()  : void
Set the link item attributes.

Constants

CONTAINER_CLASSES

Additional container classes.

protected array<string|int, string> CONTAINER_CLASSES = array('pnet-button-container')
Tags
since
6.0.0

CONTAINER_DEFAULTS

Default container settings.

protected array<string|int, mixed> CONTAINER_DEFAULTS = array('aria_label' => 'links', 'class' => '', 'classes' => array('pnet-links-list'))

CONTAINER_DEFAULTS { Container arguments. @type string $aria_label The text for the nav element ARIA label. @type string $class The class tag markup. This is built in the set_item_attributes method. @type string[] $classes Class(es) to apply to container. }

Tags
since
5.5.0

EXTERNAL_RELS

External link rel attributes.

protected array<string|int, string> EXTERNAL_RELS = array('external', 'noopener')
Tags
since
5.12.0

ITEM_DEFAULTS

Default list item settings.

protected array<string|int, mixed> ITEM_DEFAULTS = array('class' => '', 'classes' => array(), 'new_tab' => false, 'rel' => '', 'rels' => array(), 'service' => '', 'icon' => '', 'target' => '', 'text' => '', 'title' => '', 'url' => '')

ITEM_DEFAULTS { List item arguments. @type string $class The class tag markup. This is built in the set_item_attributes method. @type string[] $classes Class(es) to apply to link. @type bool $new_tab New browser window flag. @type string $rel The rel tag markup. This is built in the set_item_attributes method. @type string[] $rels The array of link rel attributes. @type string $service The type of external service. @type string $icon The icon SVG markup. @type string $target The target tag markup. This is built in the set_item_attributes method. @type string $text The link text. @type string $title The link title attribute. @type string $url The link URL. }

Tags
since
5.5.0

Additional link item classes.

protected array<string|int, string> LINK_CLASSES = array('pnet-button', 'pnet-icon-link')
Tags
since
6.0.0

LIST_CONTAINER

The links container partial filename.

protected string LIST_CONTAINER = 'link-list.php'
Tags
since
5.5.0

LIST_ITEM_CONTAINER

The link item partial filename.

protected string LIST_ITEM_CONTAINER = 'link-icon.php'
Tags
since
6.0.0

Properties

$icons

The instance of the SVG icon handler.

protected Icons $icons
Tags
since
5.12.0

$instances

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

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

$list_container

The fully qualified path to the list container partial.

protected string $list_container = ''
Tags
since
5.5.0

$list_item_container

The fully qualified path to the list item container partial.

protected string $list_item_container = ''
Tags
since
5.5.0

Methods

get_instance()

Creates and/or returns the instance of this class.

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

The instance of this class.

render()

Render the list of links.

public render(array<string|int, mixed> $item_atts[, array<string|int, mixed> $container_atts = array() ]) : void
Parameters
$item_atts : array<string|int, mixed>

An array of items and their attibutes.

$container_atts : array<string|int, mixed> = array()

Optional. An array of container display attributes.

Tags
since
5.5.0
since
6.0.0

Add parameters and change function signature.

see
Links::ITEM_DEFAULTS
see
Links::CONTAINER_DEFAULTS

__construct()

Initialise the class and set its properties.

protected __construct() : void
Tags
since
5.5.0
since
5.12.0

Refactor to simplify sub-classes.

since
6.0.0

Make singleton class.

uses
Icons

get_rel_atts()

Return the link rel attributes.

protected get_rel_atts(array<string|int, mixed> $item_atts) : array<string|int, string>
Parameters
$item_atts : array<string|int, mixed>

An array of items and their attibutes.

Tags
since
5.12.0
see
Links::ITEM_DEFAULTS
Return values
array<string|int, string>

The array of rel attribute values.

render_items()

Render the link list item.

protected render_items() : void

(Maybe) override this in sub-classes.

Tags
since
5.5.0
since
5.12.0

Refactor to simplify sub-classes.

set_container_attributes()

Set the link container attributes.

protected set_container_attributes([array<string|int, mixed> $container_atts = array() ]) : void
Parameters
$container_atts : array<string|int, mixed> = array()

Optional. An array of container display attributes.

Tags
since
6.0.0
see
Links::CONTAINER_DEFAULTS

set_item_attributes()

Set the link item attributes.

protected set_item_attributes(array<string|int, mixed> $item_atts) : void
Parameters
$item_atts : array<string|int, mixed>

An array of items and their attibutes.

Tags
since
6.0.0
uses
Icons::get_icon()
see
Links::ITEM_DEFAULTS

        
On this page

Search results