Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 302-312 (lines=11) @@
299
		}
300
301
		switch ( $this->type ) {
302
			case 'theme_mod' :
303
				if ( ! $is_multidimensional ) {
304
					add_filter( "theme_mod_{$id_base}", array( $this, '_preview_filter' ) );
305
				} else {
306
					if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {
307
						// Only add this filter once for this ID base.
308
						add_filter( "theme_mod_{$id_base}", $multidimensional_filter );
309
					}
310
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
311
				}
312
				break;
313
			case 'option' :
314
				if ( ! $is_multidimensional ) {
315
					add_filter( "pre_option_{$id_base}", array( $this, '_preview_filter' ) );
@@ 313-324 (lines=12) @@
310
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
311
				}
312
				break;
313
			case 'option' :
314
				if ( ! $is_multidimensional ) {
315
					add_filter( "pre_option_{$id_base}", array( $this, '_preview_filter' ) );
316
				} else {
317
					if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {
318
						// Only add these filters once for this ID base.
319
						add_filter( "option_{$id_base}", $multidimensional_filter );
320
						add_filter( "default_option_{$id_base}", $multidimensional_filter );
321
					}
322
					self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this;
323
				}
324
				break;
325
			default :
326
327
				/**