-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfunctions-theme-options-social-links.php
132 lines (127 loc) · 5.27 KB
/
functions-theme-options-social-links.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
// THEME OPTIONS - SOCIAL LINKS
function lightwords_customize_register_social_links($wp_customize)
{
// Sections
$wp_customize->add_section('lightwords_social_links', array(
'title' => __('Social links', 'theme'),
'description' => __('Site-wide social networks links'),
'priority' => 7000,
'capability' => 'edit_theme_options',
));
// Settings
$wp_customize->add_setting('lw_social_links', array('default' => true, 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_topbar', array('default' => true, 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_facebook', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_twitter', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_googlePlus', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_linkedin', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_youtube', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_viadeo', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_email', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_tumblr', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_reddit', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_pinterest', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_pocket', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_social_links_github', array('default' => "", 'transport' => 'refresh'));
// Controls
$wp_customize->add_control('lw_social_links', array(
'type' => 'checkbox',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Social links'),
'description' => __('Enable social networks links'),
));
$wp_customize->add_control('lw_social_links_topbar', array(
'type' => 'checkbox',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Social links in topbar'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_facebook', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Facebook'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_twitter', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Twitter'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_googlePlus', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Google+'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_linkedin', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Linkedin'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_youtube', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Youtube'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_viadeo', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Viadeo'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_email', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Email'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_tumblr', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Tumblr'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_reddit', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Reddit'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_pinterest', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Pinterest'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_pocket', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Pocket'),
'description' => __(''),
));
$wp_customize->add_control('lw_social_links_github', array(
'type' => 'url',
'priority' => 1,
'section' => 'lightwords_social_links',
'label' => __('Github'),
'description' => __(''),
));
}
add_action('customize_register', 'lightwords_customize_register_social_links');