Conditions | 1 |
Paths | 1 |
Total Lines | 51 |
Code Lines | 12 |
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 |
||
170 | protected function content_template() { |
||
171 | ?> |
||
172 | <div class="kirki-controls-loading-spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div> |
||
173 | <label> |
||
174 | <span class="customize-control-title"> |
||
175 | {{{ data.label }}} |
||
176 | </span> |
||
177 | <# if ( data.description ) { #> |
||
178 | <span class="description customize-control-description">{{{ data.description }}}</span> |
||
179 | <# } #> |
||
180 | </label> |
||
181 | <div class="gradient-preview" style="width:{{ data.choices.preview.width }};height:{{ data.choices.preview.height }}"></div> |
||
182 | <div class="global"> |
||
183 | <div class="mode"> |
||
184 | <h4><?php esc_attr_e( 'Mode', 'kirki' ); ?></h4> |
||
185 | <input class="switch-input screen-reader-text" type="radio" value="linear" name="_customize-gradient-{{{ data.id }}}" id="{{ data.id }}linear" <# if ( ! _.isUndefined( data.value.mode ) && 'linear' === data.value.mode ) { #> checked="checked" <# } #>> |
||
186 | <label class="switch-label switch-label-<# if ( ! _.isUndefined( data.value.mode ) && 'linear' === data.value.mode ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}linear"><span class="dashicons dashicons-minus"></span><span class="screen-reader-text"><?php esc_attr_e( 'Linear', 'kirki' ); ?></span></label> |
||
187 | </input> |
||
188 | <input class="switch-input screen-reader-text" type="radio" value="radial" name="_customize-gradient-{{{ data.id }}}" id="{{ data.id }}radial" <# if ( ! _.isUndefined( data.value.mode ) && 'radial' === data.value.mode ) { #> checked="checked" <# } #>> |
||
189 | <label class="switch-label switch-label-<# if ( ! _.isUndefined( data.value.mode ) && 'radial' === data.value.mode ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}radial"><span class="dashicons dashicons-marker"></span><span class="screen-reader-text"><?php esc_attr_e( 'Radial', 'kirki' ); ?></span></label> |
||
190 | </input> |
||
191 | </div> |
||
192 | <div class="angle"> |
||
193 | <h4><?php esc_attr_e( 'Angle', 'kirki' ); ?></h4> |
||
194 | <input type="range" class="angle gradient-{{ data.id }}" value="{{ data.value.angle }}" min="-90" max="90"> |
||
195 | </div> |
||
196 | </div> |
||
197 | <div class="colors"> |
||
198 | <div class="color-start"> |
||
199 | <div class="color"> |
||
200 | <h4><?php esc_attr_e( 'Start Color', 'kirki' ); ?></h4> |
||
201 | <input type="text" {{{ data.inputAttrs }}} data-palette="{{ data.palette }}" data-default-color="{{ data.default.start.color }}" data-alpha="{{ data.choices['alpha'] }}" value="{{ data.value.start.color }}" class="kirki-gradient-control-start color-picker" /> |
||
202 | </div> |
||
203 | <div class="position"> |
||
204 | <h4><?php esc_attr_e( 'Color Stop', 'kirki' ); ?></h4> |
||
205 | <input type="range" class="position gradient-{{ data.id }}-start" value="{{ data.value.start.position }}" min="0" max="100"> |
||
206 | </div> |
||
207 | </div> |
||
208 | <div class="color-end"> |
||
209 | <div class="color"> |
||
210 | <h4><?php esc_attr_e( 'End Color', 'kirki' ); ?></h4> |
||
211 | <input type="text" {{{ data.inputAttrs }}} data-palette="{{ data.palette }}" data-default-color="{{ data.default.end.color }}" data-alpha="{{ data.choices['alpha'] }}" value="{{ data.value.end.color }}" class="kirki-gradient-control-end color-picker" /> |
||
212 | </div> |
||
213 | <div class="position"> |
||
214 | <h4><?php esc_attr_e( 'Color Stop', 'kirki' ); ?></h4> |
||
215 | <input type="range" class="position gradient-{{ data.id }}-end" value="{{ data.value.end.position }}" min="0" max="100"> |
||
216 | </div> |
||
217 | </div> |
||
218 | </div> |
||
219 | <?php |
||
220 | } |
||
221 | } |
||
222 |