Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 1252-1260 (lines=9) @@
1249
1250
		// Options.
1251
		foreach ( $options as $name => $value ) {
1252
			if ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) ) {
1253
				if ( isset( $posts[ $matches['symbol'] ] ) ) {
1254
					$value = $posts[ $matches['symbol'] ]['ID'];
1255
				} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {
1256
					$value = $attachment_ids[ $matches['symbol'] ];
1257
				} else {
1258
					continue;
1259
				}
1260
			}
1261
1262
			if ( empty( $changeset_data[ $name ] ) || ! empty( $changeset_data[ $name ]['starter_content'] ) ) {
1263
				$this->set_post_value( $name, $value );
@@ 1270-1278 (lines=9) @@
1267
1268
		// Theme mods.
1269
		foreach ( $theme_mods as $name => $value ) {
1270
			if ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) ) {
1271
				if ( isset( $posts[ $matches['symbol'] ] ) ) {
1272
					$value = $posts[ $matches['symbol'] ]['ID'];
1273
				} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {
1274
					$value = $attachment_ids[ $matches['symbol'] ];
1275
				} else {
1276
					continue;
1277
				}
1278
			}
1279
1280
			// Handle header image as special case since setting has a legacy format.
1281
			if ( 'header_image' === $name ) {