| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 149 | 
| Code Lines | 30 | 
| 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  | 
            ||
| 182 | 	protected function content_template() { | 
            ||
| 183 | ?>  | 
            ||
| 184 | <div class="kirki-controls-loading-spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>  | 
            ||
| 185 | <label class="customizer-text">  | 
            ||
| 186 | 			<# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #> | 
            ||
| 187 | 			<# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #> | 
            ||
| 188 | </label>  | 
            ||
| 189 | |||
| 190 | <div class="wrapper">  | 
            ||
| 191 | |||
| 192 | 			<# if ( data.default['font-family'] ) { #> | 
            ||
| 193 | 				<# if ( '' == data.value['font-family'] ) { data.value['font-family'] = data.default['font-family']; } #> | 
            ||
| 194 | 				<# if ( data.choices['fonts'] ) { data.fonts = data.choices['fonts']; } #> | 
            ||
| 195 | <div class="font-family">  | 
            ||
| 196 | <h5><?php esc_attr_e( 'Font Family', 'kirki' ); ?></h5>  | 
            ||
| 197 | 					<select {{{ data.inputAttrs }}} id="kirki-typography-font-family-{{{ data.id }}}" placeholder="<?php esc_attr_e( 'Select Font Family', 'kirki' ); ?>"></select> | 
            ||
| 198 | </div>  | 
            ||
| 199 | 				<# if ( ! _.isUndefined( data.choices['font-backup'] ) && true === data.choices['font-backup'] ) { #> | 
            ||
| 200 | <div class="font-backup hide-on-standard-fonts kirki-font-backup-wrapper">  | 
            ||
| 201 | <h5><?php esc_attr_e( 'Backup Font', 'kirki' ); ?></h5>  | 
            ||
| 202 | 						<select {{{ data.inputAttrs }}} id="kirki-typography-font-backup-{{{ data.id }}}" placeholder="<?php esc_attr_e( 'Select Font Family', 'kirki' ); ?>"></select> | 
            ||
| 203 | </div>  | 
            ||
| 204 | <# } #>  | 
            ||
| 205 | 				<# if ( true === data.show_variants || false !== data.default.variant ) { #> | 
            ||
| 206 | <div class="variant kirki-variant-wrapper">  | 
            ||
| 207 | <h5><?php esc_attr_e( 'Variant', 'kirki' ); ?></h5>  | 
            ||
| 208 | 						<select {{{ data.inputAttrs }}} class="variant" id="kirki-typography-variant-{{{ data.id }}}"></select> | 
            ||
| 209 | </div>  | 
            ||
| 210 | <# } #>  | 
            ||
| 211 | 				<# if ( true === data.show_subsets ) { #> | 
            ||
| 212 | <div class="subsets hide-on-standard-fonts kirki-subsets-wrapper">  | 
            ||
| 213 | <h5><?php esc_attr_e( 'Subset(s)', 'kirki' ); ?></h5>  | 
            ||
| 214 | 						<select {{{ data.inputAttrs }}} class="subset" id="kirki-typography-subsets-{{{ data.id }}}"<# if ( _.isUndefined( data.choices['disable-multiple-variants'] ) || false === data.choices['disable-multiple-variants'] ) { #> multiple<# } #>> | 
            ||
| 215 | 							<# _.each( data.value.subsets, function( subset ) { #> | 
            ||
| 216 | 								<option value="{{ subset }}" selected="selected">{{ data.languages[ subset ] }}</option> | 
            ||
| 217 | <# } ); #>  | 
            ||
| 218 | </select>  | 
            ||
| 219 | </div>  | 
            ||
| 220 | <# } #>  | 
            ||
| 221 | <# } #>  | 
            ||
| 222 | |||
| 223 | 			<# if ( data.default['font-size'] ) { #> | 
            ||
| 224 | <div class="font-size">  | 
            ||
| 225 | <h5><?php esc_attr_e( 'Font Size', 'kirki' ); ?></h5>  | 
            ||
| 226 | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['font-size'] }}"/> | 
            ||
| 227 | </div>  | 
            ||
| 228 | <# } #>  | 
            ||
| 229 | |||
| 230 | 			<# if ( data.default['line-height'] ) { #> | 
            ||
| 231 | <div class="line-height">  | 
            ||
| 232 | <h5><?php esc_attr_e( 'Line Height', 'kirki' ); ?></h5>  | 
            ||
| 233 | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['line-height'] }}"/> | 
            ||
| 234 | </div>  | 
            ||
| 235 | <# } #>  | 
            ||
| 236 | |||
| 237 | 			<# if ( data.default['letter-spacing'] ) { #> | 
            ||
| 238 | <div class="letter-spacing">  | 
            ||
| 239 | <h5><?php esc_attr_e( 'Letter Spacing', 'kirki' ); ?></h5>  | 
            ||
| 240 | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['letter-spacing'] }}"/> | 
            ||
| 241 | </div>  | 
            ||
| 242 | <# } #>  | 
            ||
| 243 | |||
| 244 | 			<# if ( data.default['word-spacing'] ) { #> | 
            ||
| 245 | <div class="word-spacing">  | 
            ||
| 246 | <h5><?php esc_attr_e( 'Word Spacing', 'kirki' ); ?></h5>  | 
            ||
| 247 | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['word-spacing'] }}"/> | 
            ||
| 248 | </div>  | 
            ||
| 249 | <# } #>  | 
            ||
| 250 | |||
| 251 | 			<# if ( data.default['text-align'] ) { #> | 
            ||
| 252 | <div class="text-align">  | 
            ||
| 253 | <h5><?php esc_attr_e( 'Text Align', 'kirki' ); ?></h5>  | 
            ||
| 254 | 					<input {{{ data.inputAttrs }}} type="radio" value="inherit" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-inherit" <# if ( data.value['text-align'] === 'inherit' ) { #> checked="checked"<# } #>> | 
            ||
| 255 | 						<label for="{{ data.id }}-text-align-inherit"> | 
            ||
| 256 | <span class="dashicons dashicons-editor-removeformatting"></span>  | 
            ||
| 257 | <span class="screen-reader-text"><?php esc_attr_e( 'Inherit', 'kirki' ); ?></span>  | 
            ||
| 258 | </label>  | 
            ||
| 259 | </input>  | 
            ||
| 260 | 					<input {{{ data.inputAttrs }}} type="radio" value="left" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-left" <# if ( data.value['text-align'] === 'left' ) { #> checked="checked"<# } #>> | 
            ||
| 261 | 						<label for="{{ data.id }}-text-align-left"> | 
            ||
| 262 | <span class="dashicons dashicons-editor-alignleft"></span>  | 
            ||
| 263 | <span class="screen-reader-text"><?php esc_attr_e( 'Left', 'kirki' ); ?></span>  | 
            ||
| 264 | </label>  | 
            ||
| 265 | </input>  | 
            ||
| 266 | 					<input {{{ data.inputAttrs }}} type="radio" value="center" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-center" <# if ( data.value['text-align'] === 'center' ) { #> checked="checked"<# } #>> | 
            ||
| 267 | 						<label for="{{ data.id }}-text-align-center"> | 
            ||
| 268 | <span class="dashicons dashicons-editor-aligncenter"></span>  | 
            ||
| 269 | <span class="screen-reader-text"><?php esc_attr_e( 'Center', 'kirki' ); ?></span>  | 
            ||
| 270 | </label>  | 
            ||
| 271 | </input>  | 
            ||
| 272 | 					<input {{{ data.inputAttrs }}} type="radio" value="right" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-right" <# if ( data.value['text-align'] === 'right' ) { #> checked="checked"<# } #>> | 
            ||
| 273 | 						<label for="{{ data.id }}-text-align-right"> | 
            ||
| 274 | <span class="dashicons dashicons-editor-alignright"></span>  | 
            ||
| 275 | <span class="screen-reader-text"><?php esc_attr_e( 'Right', 'kirki' ); ?></span>  | 
            ||
| 276 | </label>  | 
            ||
| 277 | </input>  | 
            ||
| 278 | 					<input {{{ data.inputAttrs }}} type="radio" value="justify" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-justify" <# if ( data.value['text-align'] === 'justify' ) { #> checked="checked"<# } #>> | 
            ||
| 279 | 						<label for="{{ data.id }}-text-align-justify"> | 
            ||
| 280 | <span class="dashicons dashicons-editor-justify"></span>  | 
            ||
| 281 | <span class="screen-reader-text"><?php esc_attr_e( 'Justify', 'kirki' ); ?></span>  | 
            ||
| 282 | </label>  | 
            ||
| 283 | </input>  | 
            ||
| 284 | </div>  | 
            ||
| 285 | <# } #>  | 
            ||
| 286 | |||
| 287 | 			<# if ( data.default['text-transform'] ) { #> | 
            ||
| 288 | <div class="text-transform">  | 
            ||
| 289 | <h5><?php esc_attr_e( 'Text Transform', 'kirki' ); ?></h5>  | 
            ||
| 290 | 					<select {{{ data.inputAttrs }}} id="kirki-typography-text-transform-{{{ data.id }}}"> | 
            ||
| 291 | 						<option value="none"<# if ( 'none' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'None', 'kirki' ); ?></option> | 
            ||
| 292 | 						<option value="capitalize"<# if ( 'capitalize' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Capitalize', 'kirki' ); ?></option> | 
            ||
| 293 | 						<option value="uppercase"<# if ( 'uppercase' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Uppercase', 'kirki' ); ?></option> | 
            ||
| 294 | 						<option value="lowercase"<# if ( 'lowercase' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Lowercase', 'kirki' ); ?></option> | 
            ||
| 295 | 						<option value="initial"<# if ( 'initial' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Initial', 'kirki' ); ?></option> | 
            ||
| 296 | 						<option value="inherit"<# if ( 'inherit' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Inherit', 'kirki' ); ?></option> | 
            ||
| 297 | </select>  | 
            ||
| 298 | </div>  | 
            ||
| 299 | <# } #>  | 
            ||
| 300 | |||
| 301 | 			<# if ( false !== data.default['color'] && data.default['color'] ) { #> | 
            ||
| 302 | <div class="color">  | 
            ||
| 303 | <h5><?php esc_attr_e( 'Color', 'kirki' ); ?></h5>  | 
            ||
| 304 | 					<input {{{ data.inputAttrs }}} type="text" data-palette="{{ data.palette }}" data-default-color="{{ data.default['color'] }}" value="{{ data.value['color'] }}" class="kirki-color-control" {{{ data.link }}} /> | 
            ||
| 305 | </div>  | 
            ||
| 306 | <# } #>  | 
            ||
| 307 | |||
| 308 | 			<# if ( data.default['margin-top'] ) { #> | 
            ||
| 309 | <div class="margin-top">  | 
            ||
| 310 | <h5><?php esc_attr_e( 'Margin Top', 'kirki' ); ?></h5>  | 
            ||
| 311 | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['margin-top'] }}"/> | 
            ||
| 312 | </div>  | 
            ||
| 313 | <# } #>  | 
            ||
| 314 | |||
| 315 | 			<# if ( data.default['margin-bottom'] ) { #> | 
            ||
| 316 | <div class="margin-bottom">  | 
            ||
| 317 | <h5><?php esc_attr_e( 'Margin Bottom', 'kirki' ); ?></h5>  | 
            ||
| 318 | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['margin-bottom'] }}"/> | 
            ||
| 319 | </div>  | 
            ||
| 320 | <# } #>  | 
            ||
| 321 | </div>  | 
            ||
| 322 | <#  | 
            ||
| 323 | 		if ( ! _.isUndefined( data.value['font-family'] ) ) { | 
            ||
| 324 | data.value['font-family'] = data.value['font-family'].replace( /"/g, ''' );  | 
            ||
| 325 | }  | 
            ||
| 326 | valueJSON = JSON.stringify( data.value ).replace( /'/g, ''' );  | 
            ||
| 327 | #>  | 
            ||
| 328 | 		<input class="typography-hidden-value" type="hidden" value='{{{ valueJSON }}}' {{{ data.link }}}> | 
            ||
| 329 | <?php  | 
            ||
| 330 | }  | 
            ||
| 331 | |||
| 458 |