pfeifferNet

Social
in package

AbstractYes

Basic social media functionality.

Provides social media buttons using inline SVG icons.

Tags
since
5.0.0
since
5.5.0

Inherit standard singleton class.

since
5.11.0

Deprecated global singleton.

used-by
Follow

Table of Contents

Constants

CONTAINER_DEFAULTS  = array('aria_label' => '', 'classes' => array('pnet-social-list'))
Default container settings.

Properties

$container_atts  : array<string|int, mixed>
Social list container attributes.
$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>
Social list item attributes.
$renderer  : Link_List
The instance of class to render the social links list.
$settings  : array<string|int, mixed>
Site settings.

Methods

get_instance()  : object
Creates and/or returns the instance of this class.
render()  : void
Render the social list of links.
__construct()  : void
Initialise the class.
get_page_thumbnail()  : string
Get page or post thumbnail.
get_page_title()  : string
Get page or post title.
get_page_url()  : string
Get page or post url.
get_twitter_name()  : string
Get page or post author twitter name if it exists.
set_list_container()  : void
Set social list container definitions.
set_list_items()  : void
Set social list item definitions.
set_renderer()  : void
Set the class to render the social list.

Constants

CONTAINER_DEFAULTS

Default container settings.

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

CONTAINER_DEFAULTS { Definition of the social menu links. @type string $aria_label The text for the nav element ARIA label. @type string[] $classes The array of classes for the links list container.. }

Tags
since
5.5.0
see
Link_Buttons::CONTAINER_DEFAULTS

Properties

$container_atts

Social list container attributes.

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

{ Social list container attributes. @type string[] $classes The container CSS classes. @type int $author_id The id of the post or page author. }

Tags
since
5.0.0

$icons

The instance of the SVG icon handler.

protected Icons $icons
Tags
since
6.0.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

$item_atts

Social list item attributes.

protected array<string|int, mixed> $item_atts = array()

{ Social list item attributes. @type string $service Service name. @type string $text Text to display on the button. @type string $url The URL the button points to. @type string $title The title attribute of the button. $type bool $new_tab Use new tab flag. }

Tags
since
5.0.0

$renderer

The instance of class to render the social links list.

protected Link_List $renderer
Tags
since
6.0.0

$settings

Site settings.

protected array<string|int, mixed> $settings = array()
Tags
since
6.3.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.

render()

Render the social list of links.

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

Array of display attributes.

Tags
since
5.5.0
since
6.0.0

Refactor to allow sub-classes to set rendering class.

__construct()

Initialise the class.

protected __construct() : void

Set the class to render links in the "use" declaration.

Tags
since
5.11.0
since
6.0.0

Change class definition to render links list.

since
6.3.0

Use settings class to get site settings.

uses
Icons
uses
Settings
uses
Settings::get()

get_page_title()

Get page or post title.

protected get_page_title() : string
Tags
since
5.0.0
Return values
string

The current page title.

get_page_url()

Get page or post url.

protected get_page_url() : string
Tags
since
5.0.0
Return values
string

The url of current page.

get_twitter_name()

Get page or post author twitter name if it exists.

protected get_twitter_name([int $author_id = 0 ]) : string
Parameters
$author_id : int = 0

User id of the post author.

Tags
since
1.0.0
Return values
string

set_list_container()

Set social list container definitions.

protected set_list_container(array<string|int, mixed> $args) : void

Override this in subclass to set list container properties.

Parameters
$args : array<string|int, mixed>

Array of display attributes.

Tags
since
6.0.0

set_list_items()

Set social list item definitions.

protected set_list_items() : void

Override this in subclass to set list contents.

Tags
since
5.5.0
since
6.0.0

Add arguments parameter.

set_renderer()

Set the class to render the social list.

protected set_renderer() : void

Override this by the "use" declaration in subclasses to set the renderer.

Tags
since
6.0.0
uses
Link_List

        
On this page

Search results