1 | <?php |
||
5 | class PodsField_Icon extends PodsField { |
||
6 | |||
7 | /** |
||
8 | * Field Type Identifier |
||
9 | * |
||
10 | * @var string |
||
11 | * @since 2.0 |
||
12 | */ |
||
13 | public static $type = 'icon'; |
||
14 | |||
15 | /** |
||
16 | * Field Type Label |
||
17 | * |
||
18 | * @var string |
||
19 | * @since 2.0 |
||
20 | */ |
||
21 | public static $label = 'Icon Picker'; |
||
22 | |||
23 | /** |
||
24 | * Field Type Preparation |
||
25 | * |
||
26 | * @var string |
||
27 | * @since 2.0 |
||
28 | */ |
||
29 | public static $prepare = '%s'; |
||
30 | |||
31 | /** |
||
32 | * Do things like register/enqueue scripts and stylesheets |
||
33 | * |
||
34 | * @since 2.0 |
||
35 | */ |
||
36 | public function __construct () { |
||
45 | |||
46 | /** |
||
47 | * Add options and set defaults to |
||
48 | * |
||
49 | * |
||
50 | * @return array |
||
51 | * @since 2.0 |
||
52 | */ |
||
53 | public function options () { |
||
73 | |||
74 | /** |
||
75 | * Define the current field's schema for DB table storage |
||
76 | * |
||
77 | * @param array $options |
||
78 | * |
||
79 | * @return string |
||
80 | * @since 2.0 |
||
81 | */ |
||
82 | public function schema ( $options = null ) { |
||
86 | |||
87 | /** |
||
88 | * Change the way the value of the field is displayed with Pods::get |
||
89 | * |
||
90 | * @param mixed $value |
||
91 | * @param string $name |
||
92 | * @param array $options |
||
93 | * @param array $pod |
||
94 | * @param int $id |
||
95 | * |
||
96 | * @return mixed|null|string |
||
97 | * @since 2.0 |
||
98 | */ |
||
99 | public function display ( $value = null, $name = null, $options = null, $pod = null, $id = null ) { |
||
105 | |||
106 | /** |
||
107 | * Customize output of the form field |
||
108 | * |
||
109 | * @param string $name |
||
110 | * @param mixed $value |
||
111 | * @param array $options |
||
112 | * @param array $pod |
||
113 | * @param int $id |
||
114 | * |
||
115 | * @since 2.0 |
||
116 | */ |
||
117 | public function input ( $name, $value = null, $options = null, $pod = null, $id = null ) { |
||
133 | |||
134 | /** |
||
135 | * Validate a value before it's saved |
||
136 | * |
||
137 | * @param mixed $value |
||
138 | * @param string $name |
||
139 | * @param array $options |
||
140 | * @param array $fields |
||
141 | * @param array $pod |
||
142 | * @param int $id |
||
143 | * |
||
144 | * @param null $params |
||
145 | * @return array|bool |
||
146 | * @since 2.0 |
||
147 | */ |
||
148 | public function validate ( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) { |
||
165 | |||
166 | /** |
||
167 | * Change the value or perform actions after validation but before saving to the DB |
||
168 | * |
||
169 | * @param mixed $value |
||
170 | * @param int $id |
||
171 | * @param string $name |
||
172 | * @param array $options |
||
173 | * @param array $fields |
||
174 | * @param array $pod |
||
175 | * @param object $params |
||
176 | * |
||
177 | * @return mixed|string |
||
178 | * @since 2.0 |
||
179 | */ |
||
180 | public function pre_save ( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
||
192 | |||
193 | /** |
||
194 | * Customize the Pods UI manage table column output |
||
195 | * |
||
196 | * @param int $id |
||
197 | * @param mixed $value |
||
198 | * @param string $name |
||
199 | * @param array $options |
||
200 | * @param array $fields |
||
201 | * @param array $pod |
||
202 | * |
||
203 | * @return mixed|string |
||
204 | * @since 2.0 |
||
205 | */ |
||
206 | public function ui ( $id, $value, $name = null, $options = null, $fields = null, $pod = null ) { |
||
214 | } |
||
215 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.