1
|
|
|
<?php |
|
|
|
|
2
|
|
|
/** |
3
|
|
|
* Trulia Badges |
4
|
|
|
* |
5
|
|
|
* @package RE-PRO |
6
|
|
|
* |
7
|
|
|
* Returns an array of available Trulia Badges |
8
|
|
|
* All badges can be found at http://www.trulia.com/tools/badge/ |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
/* // Exit if accessed directly */ |
12
|
|
|
if ( ! defined( 'ABSPATH' ) ) { exit; } |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* The trulia_badges function. |
16
|
|
|
* |
17
|
|
|
* @access public |
18
|
|
|
* @return Array of Trulia Badges |
19
|
|
|
*/ |
20
|
|
|
function trulia_badges() { |
21
|
|
|
|
22
|
|
|
return array( |
23
|
|
|
/* Style 1 */ |
24
|
|
|
array( |
25
|
|
|
'id' => 'truila-btn-1-green', |
26
|
|
|
'name' => __( 'Trulia Button - Green (96x40)', 're-pro' ), |
27
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
28
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
29
|
|
|
'class' => 'trulia-badge', |
30
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_green.gif', |
31
|
|
|
'width' => 96, |
32
|
|
|
'height' => 40, |
33
|
|
|
), |
34
|
|
|
array( |
35
|
|
|
'id' => 'truila-btn-1-white', |
36
|
|
|
'name' => __( 'Trulia Button - White (96x40)', 're-pro' ), |
37
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
38
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
39
|
|
|
'class' => 'trulia-badge', |
40
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_white.gif', |
41
|
|
|
'width' => 96, |
42
|
|
|
'height' => 40, |
43
|
|
|
), |
44
|
|
|
array( |
45
|
|
|
'id' => 'truila-btn-1-white-green', |
46
|
|
|
'name' => __( 'Trulia Button - White/Green (96x40)', 're-pro' ), |
47
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
48
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
49
|
|
|
'class' => 'trulia-badge', |
50
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_white_green.gif', |
51
|
|
|
'width' => 96, |
52
|
|
|
'height' => 40, |
53
|
|
|
), |
54
|
|
|
/* Style 2 */ |
55
|
|
|
array( |
56
|
|
|
'id' => 'truila-btn-2-green', |
57
|
|
|
'name' => __( 'Trulia Button 2 - Green (87x33)', 're-pro' ), |
58
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
59
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
60
|
|
|
'class' => 'trulia-badge', |
61
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_green.gif', |
62
|
|
|
'width' => 87, |
63
|
|
|
'height' => 33, |
64
|
|
|
), |
65
|
|
|
array( |
66
|
|
|
'id' => 'truila-btn-2-white', |
67
|
|
|
'name' => __( 'Trulia Button 2 - White (87x33)', 're-pro' ), |
68
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
69
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
70
|
|
|
'class' => 'trulia-badge', |
71
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_white.gif', |
72
|
|
|
'width' => 87, |
73
|
|
|
'height' => 33, |
74
|
|
|
), |
75
|
|
|
array( |
76
|
|
|
'id' => 'truila-btn-2-white-green', |
77
|
|
|
'name' => __( 'Trulia Button 2 - White/Green (87x33)', 're-pro' ), |
78
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
79
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
80
|
|
|
'class' => 'trulia-badge', |
81
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_white_green.gif', |
82
|
|
|
'width' => 87, |
83
|
|
|
'height' => 33, |
84
|
|
|
), |
85
|
|
|
/* Style 3 */ |
86
|
|
|
array( |
87
|
|
|
'id' => 'truila-btn-3-green', |
88
|
|
|
'name' => __( 'Trulia Button 3 - Green (120x54)', 're-pro' ), |
89
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
90
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
91
|
|
|
'class' => 'trulia-badge', |
92
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_green.gif', |
93
|
|
|
'width' => 120, |
94
|
|
|
'height' => 54, |
95
|
|
|
), |
96
|
|
|
array( |
97
|
|
|
'id' => 'truila-btn-3-white', |
98
|
|
|
'name' => __( 'Trulia Button 3 - White (120x54)', 're-pro' ), |
99
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
100
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
101
|
|
|
'class' => 'trulia-badge', |
102
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_white.gif', |
103
|
|
|
'width' => 120, |
104
|
|
|
'height' => 54, |
105
|
|
|
), |
106
|
|
|
array( |
107
|
|
|
'id' => 'truila-btn-3-white-green', |
108
|
|
|
'name' => __( 'Trulia Button 3 - White/Green (120x54)', 're-pro' ), |
109
|
|
|
'alt' => __( 'Trulia', 're-pro' ), |
110
|
|
|
'title' => __( 'Trulia', 're-pro' ), |
111
|
|
|
'class' => 'trulia-badge', |
112
|
|
|
'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_white_green.gif', |
113
|
|
|
'width' => 120, |
114
|
|
|
'height' => 54, |
115
|
|
|
), |
116
|
|
|
); |
117
|
|
|
} |
118
|
|
|
|
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.