pfeifferNet

Follow_Site extends Follow
in package

Display links to the site's social media.

  • Allows social following without needing scripts to be loaded.
  • Uses URL links.
Tags
since
6.0.0
uses
Follow

Table of Contents

Constants

CONTAINER_DEFAULTS  = array('aria-label' => '', 'classes' => array('pnet-social-list', 'pnet-social-list-follow'))
Default container settings.
FACEBOOK_URL  = 'https://www.facebook.com/'
Facebook follow url.
GOODREADS_URL  = 'https://www.goodreads.com/user/show/'
Goodreads follow url.
INSTAGRAM_URL  = 'https://www.instagram.com/'
Instagram follow url.
LINKEDIN_URL  = 'https://www.linkedin.com/in/'
LinkedIn follow url.
PINTEREST_URL  = 'https://www.pinterest.com/'
Pinterest follow url.
TWITTER_URL  = 'https://twitter.com/'
Twitter follow url.
YOUTUBE_URL  = 'https://www.youtube.com/channel/'
Youtube channel follow url.

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 the services that will (maybe) be shown as follow links.
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', 'pnet-social-list-follow'))

CONTAINER_DEFAULTS { Definition of the social menu container. @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
Social::CONTAINER_DEFAULTS

FACEBOOK_URL

Facebook follow url.

protected string FACEBOOK_URL = 'https://www.facebook.com/'
Tags
since
5.3.0

GOODREADS_URL

Goodreads follow url.

protected string GOODREADS_URL = 'https://www.goodreads.com/user/show/'
Tags
since
5.3.0

INSTAGRAM_URL

Instagram follow url.

protected string INSTAGRAM_URL = 'https://www.instagram.com/'
Tags
since
5.3.0

LINKEDIN_URL

LinkedIn follow url.

protected string LINKEDIN_URL = 'https://www.linkedin.com/in/'
Tags
since
5.3.0

PINTEREST_URL

Pinterest follow url.

protected string PINTEREST_URL = 'https://www.pinterest.com/'
Tags
since
5.3.0

TWITTER_URL

Twitter follow url.

protected string TWITTER_URL = 'https://twitter.com/'
Tags
since
5.3.0

YOUTUBE_URL

Youtube channel follow url.

protected string YOUTUBE_URL = 'https://www.youtube.com/channel/'
Tags
since
5.3.0

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 the services that will (maybe) be shown as follow links.

protected set_list_items() : void
Tags
since
6.0.0
uses
Icons::get_icon()

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_Icons

        
On this page

Search results