Code Duplication    Length = 11-12 lines in 2 locations

wp-includes/class-wp-customize-setting.php 2 locations

@@ 319-329 (lines=11) @@
316
		}
317
318
		switch ( $this->type ) {
319
			case 'theme_mod' :
320
				if ( ! $is_multidimensional ) {
321
					add_filter( "theme_mod_{$id_base}", array( $this, '_preview_filter' ) );
322
				} else {
323
					if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {
324
						// Only add this filter once for this ID base.
325
						add_filter( "theme_mod_{$id_base}", $multidimensional_filter );
326
					}
327
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
328
				}
329
				break;
330
			case 'option' :
331
				if ( ! $is_multidimensional ) {
332
					add_filter( "pre_option_{$id_base}", array( $this, '_preview_filter' ) );
@@ 330-341 (lines=12) @@
327
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
328
				}
329
				break;
330
			case 'option' :
331
				if ( ! $is_multidimensional ) {
332
					add_filter( "pre_option_{$id_base}", array( $this, '_preview_filter' ) );
333
				} else {
334
					if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {
335
						// Only add these filters once for this ID base.
336
						add_filter( "option_{$id_base}", $multidimensional_filter );
337
						add_filter( "default_option_{$id_base}", $multidimensional_filter );
338
					}
339
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
340
				}
341
				break;
342
			default :
343
344
				/**