\Social_Links

Social Links.

This feature will only be activated for themes that declare their support. This can be done by adding code similar to the following during the 'after_setup_theme' action:

add_theme_support( 'social-links', array(

'facebook', 'twitter', 'linkedin', 'tumblr', 'google_plus',

) );

Summary

Methods
Properties
Constants
__construct()
customize_register()
sanitize_link()
has_social_links()
get_social_links()
get_social_link_filter()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
get_customize_select()
$links
$publicize
$services
N/A

Properties

$links

$links : array

The links the user set for each service.

Type

array

$publicize

$publicize : \Publicize

A Publicize object.

Type

\Publicize

$services

$services : array

An array with all services that are supported by both Publicize and the currently active theme.

Type

array

Methods

__construct()

__construct()

Constructor.

customize_register()

customize_register(\WP_Customize_Manager $wp_customize)

Add social link dropdown to the Customizer.

Parameters

\WP_Customize_Manager $wp_customize

Theme Customizer object.

sanitize_link()

sanitize_link(array $option)

Sanitizes social links.

Parameters

array $option

The incoming values to be sanitized.

has_social_links()

has_social_links()

Returns whether there are any social links set.

get_social_links()

get_social_links()

Return available social links.

get_social_link_filter()

get_social_link_filter(string $link)

Short-circuits get_option and get_theme_mod calls.

Parameters

string $link

The incoming value to be replaced.

get_customize_select()

get_customize_select(string $service) : array

Puts together an array of choices for a specific service.

Parameters

string $service

The social service.

Returns

array —

An associative array with profile links and display names.