-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
83 lines (75 loc) · 1.33 KB
/
functions.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
<?php
/**
* Has profile picture.
*
* @return bool True if profile picture.
*/
function has_profile_picture()
{
return (site_meta('profile_picture', null) !== null);
}
function profile_picture_url()
{
switch (site_meta('profile_picture')) {
case 'instagram':
return 'https://avatars.io/instagram/' . instagram_account();
case 'twitter':
return 'https://avatars.io/twitter/' . twitter_account();
default:
return site_meta('profile_picture');
}
}
/**
* Has Twitter.
*
* @return bool True if Twitter.
*/
function has_twitter()
{
return (twitter_account() !== null);
}
/**
* Twitter account.
*
* @return string Twitter account.
*/
function twitter_account()
{
return site_meta('twitter', null);
}
/**
* Twitter URL.
*
* @return string Twitter URL.
*/
function twitter_url()
{
return 'https://twitter.com/' . twitter_account();
}
/**
* Has Instagram.
*
* @return bool True if Instagram.
*/
function has_instagram()
{
return (instagram_account() !== null);
}
/**
* Instagram account.
*
* @return string Instagram account.
*/
function instagram_account()
{
return site_meta('instagram', null);
}
/**
* Instagram URL.
*
* @return string Instagram URL.
*/
function instagram_url()
{
return 'https://instagram.com/' . instagram_account();
}