Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 368-378 (lines=11) @@
365
		}
366
367
		switch ( $this->type ) {
368
			case 'theme_mod' :
369
				if ( ! $is_multidimensional ) {
370
					add_filter( "theme_mod_{$id_base}", array( $this, '_preview_filter' ) );
371
				} else {
372
					if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {
373
						// Only add this filter once for this ID base.
374
						add_filter( "theme_mod_{$id_base}", $multidimensional_filter );
375
					}
376
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
377
				}
378
				break;
379
			case 'option' :
380
				if ( ! $is_multidimensional ) {
381
					add_filter( "pre_option_{$id_base}", array( $this, '_preview_filter' ) );
@@ 379-390 (lines=12) @@
376
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
377
				}
378
				break;
379
			case 'option' :
380
				if ( ! $is_multidimensional ) {
381
					add_filter( "pre_option_{$id_base}", array( $this, '_preview_filter' ) );
382
				} else {
383
					if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {
384
						// Only add these filters once for this ID base.
385
						add_filter( "option_{$id_base}", $multidimensional_filter );
386
						add_filter( "default_option_{$id_base}", $multidimensional_filter );
387
					}
388
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
389
				}
390
				break;
391
			default :
392
393
				/**