Conditions | 1 |
Paths | 1 |
Total Lines | 79 |
Code Lines | 61 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
153 | function lsx_customizer_font_controls($lsx_controls) { |
||
154 | $lsx_controls['sections']['lsx-font'] = array( |
||
155 | 'title' => esc_html__( 'Font', 'lsx' ), |
||
156 | 'description' => 'Change the fonts sitewide.', |
||
157 | 'priority' => 41 |
||
158 | ); |
||
159 | $lsx_controls['settings']['lsx_font'] = array( |
||
160 | 'default' => 'raleway_open_sans', //Default setting/value to save |
||
161 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
||
162 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
||
163 | ); |
||
164 | /// add the control |
||
165 | $lsx_controls['fields']['lsx_font'] = array( |
||
166 | 'label' => '', |
||
167 | 'section' => 'lsx-font', |
||
168 | 'settings' => 'lsx_font', |
||
169 | 'control' => 'LSX_Customize_Font_Control', |
||
170 | 'choices' => array( |
||
171 | 'raleway_open_sans' => array( |
||
172 | 'header' => array( |
||
173 | "title" => esc_html__( 'Raleway', 'lsx' ), |
||
174 | "location" => "Raleway", |
||
175 | "cssDeclaration" => "'Raleway', sans-serif", |
||
176 | "cssClass" => "raleway", |
||
177 | ), |
||
178 | 'body' => array( |
||
179 | "title" => esc_html__( 'Open Sans', 'lsx' ), |
||
180 | "location" => "Open+Sans", |
||
181 | "cssDeclaration" => "'Open Sans', sans-serif", |
||
182 | "cssClass" => "openSans" |
||
183 | ), |
||
184 | ), |
||
185 | 'noto_serif_noto_sans' => array( |
||
186 | 'header' => array( |
||
187 | "title" => esc_html__( 'Noto Serif', 'lsx' ), |
||
188 | "location" => "Noto+Serif", |
||
189 | "cssDeclaration" => "'Noto Serif', serif", |
||
190 | "cssClass" => "notoSerif", |
||
191 | ), |
||
192 | 'body' => array( |
||
193 | "title" => esc_html__( 'Noto Sans', 'lsx' ), |
||
194 | "location" => "Noto+Sans", |
||
195 | "cssDeclaration" => "'Noto Sans', sans-serif", |
||
196 | "cssClass" => "notoSans", |
||
197 | ), |
||
198 | ), |
||
199 | 'noto_sans_noto_sans' => array( |
||
200 | 'header' => array( |
||
201 | "title" => esc_html__( 'Noto Sans', 'lsx' ), |
||
202 | "location" => "Noto+Sans", |
||
203 | "cssDeclaration" => "'Noto Sans', sans-serif", |
||
204 | "cssClass" => "notoSans", |
||
205 | ), |
||
206 | 'body' => array( |
||
207 | "title" => esc_html__( 'Noto Sans', 'lsx' ), |
||
208 | "location" => "Noto+Sans", |
||
209 | "cssDeclaration" => "'Noto Sans', sans-serif", |
||
210 | "cssClass" => "notoSans", |
||
211 | ), |
||
212 | ), |
||
213 | 'alegreya_open_sans' => array( |
||
214 | 'header' => array( |
||
215 | "title" => esc_html__( 'Alegreya', 'lsx' ), |
||
216 | "location" => "Alegreya", |
||
217 | "cssDeclaration" => "'Alegreya', serif", |
||
218 | "cssClass" => "alegreya", |
||
219 | ), |
||
220 | 'body' => array( |
||
221 | "title" => esc_html__( 'Open Sans', 'lsx' ), |
||
222 | "location" => "Open+Sans", |
||
223 | "cssDeclaration" => "'Open Sans', sans-serif", |
||
224 | "cssClass" => "openSans" |
||
225 | ), |
||
226 | ), |
||
227 | ), |
||
228 | 'priority' => 2, |
||
229 | ); |
||
230 | return $lsx_controls; |
||
231 | } |
||
232 | add_filter('lsx_customizer_controls','lsx_customizer_font_controls'); |
||
250 | add_image_size( 'lsx-thumbnail-single', 750, 350, true ); |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.