-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
51 lines (44 loc) · 1.1 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
<?php
function twitter_card() {
$internals = array(
'site', 'title',
'description', 'domain',
);
$output = "";
foreach ($internals as $internal) {
$function = 'twitter_card_' . $internal;
if(function_exists($function)) {
$result = call_user_func($function);
if (strlen($result)) {
$output .= Html::element('meta', null, array('name' =>"twitter:{$internal}", 'content' => $result));
}
}
}
return $output;
}
/**
* twitter @usename of the site.
*/
function twitter_card_site() {
return Config::meta('twitter_card_site_username');
}
function twitter_card_creator() {
return Config::meta('twitter_card_creator_username');
}
/**
* description of the site.
*/
function twitter_card_description() {
if (Config::meta('twitter_card_description') !== null) {
return Config::meta('twitter_card_description');
} else {
return Config::meta('description');
}
}
/**
* @TODO: override check
* title of the site.
*/
function twitter_card_title() {
return page_title();
}