Follow_Author
extends Follow
in package
Display links to the author's social sites.
- Allows social following without needing scripts to be loaded.
- Uses URL links.
Tags
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 be shown as follow items.
- 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
FACEBOOK_URL
Facebook follow url.
protected
string
FACEBOOK_URL
= 'https://www.facebook.com/'
Tags
GOODREADS_URL
Goodreads follow url.
protected
string
GOODREADS_URL
= 'https://www.goodreads.com/user/show/'
Tags
INSTAGRAM_URL
Instagram follow url.
protected
string
INSTAGRAM_URL
= 'https://www.instagram.com/'
Tags
LINKEDIN_URL
LinkedIn follow url.
protected
string
LINKEDIN_URL
= 'https://www.linkedin.com/in/'
Tags
PINTEREST_URL
Pinterest follow url.
protected
string
PINTEREST_URL
= 'https://www.pinterest.com/'
Tags
TWITTER_URL
Twitter follow url.
protected
string
TWITTER_URL
= 'https://twitter.com/'
Tags
YOUTUBE_URL
Youtube channel follow url.
protected
string
YOUTUBE_URL
= 'https://www.youtube.com/channel/'
Tags
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
$icons
The instance of the SVG icon handler.
protected
Icons
$icons
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$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
$renderer
The instance of class to render the social links list.
protected
Link_List
$renderer
Tags
$settings
Site settings.
protected
array<string|int, mixed>
$settings
= array()
Tags
Methods
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
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
__construct()
Initialise the class.
protected
__construct() : void
Set the class to render links in the "use" declaration.
Tags
get_page_thumbnail()
Get page or post thumbnail.
protected
get_page_thumbnail() : string
Tags
Return values
string —The current page thumbnail url.
get_page_title()
Get page or post title.
protected
get_page_title() : string
Tags
Return values
string —The current page title.
get_page_url()
Get page or post url.
protected
get_page_url() : string
Tags
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
Return values
stringset_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
set_list_items()
Set the services that will be shown as follow items.
protected
set_list_items() : void
Tags
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.