# wp_migrate_old_typography_shape()

URL: https://chugunov.pro/api-wordpress/functions/wp_migrate_old_typography_shape/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 5.8.0.

## Сигнатура

```php
wp_migrate_old_typography_shape( array $metadata ): array
```

## Описание

Выводит уведомление _doing_it_wrong() при обнаружении блока, использующего старый формат.

## Параметры

- `$metadata` `array` — обязательный. Метаданные для регистрации типа блока.

## Возвращаемое значение

`array`

## Исходный код

Файл: `wp-includes/blocks.php:2639`

```php
function wp_migrate_old_typography_shape( $metadata ) {
	if ( ! isset( $metadata['supports'] ) ) {
		return $metadata;
	}

	$typography_keys = array(
		'__experimentalFontFamily',
		'__experimentalFontStyle',
		'__experimentalFontWeight',
		'__experimentalLetterSpacing',
		'__experimentalTextDecoration',
		'__experimentalTextTransform',
		'fontSize',
		'lineHeight',
	);

	foreach ( $typography_keys as $typography_key ) {
		$support_for_key = $metadata['supports'][ $typography_key ] ?? null;

		if ( null !== $support_for_key ) {
			_doing_it_wrong(
				'register_block_type_from_metadata()',
				sprintf(
					/* translators: 1: Block type, 2: Typography supports key, e.g: fontSize, lineHeight, etc. 3: block.json, 4: Old metadata key, 5: New metadata key. */
					__( 'Block "%1$s" is declaring %2$s support in %3$s file under %4$s. %2$s support is now declared under %5$s.' ),
					$metadata['name'],
					"<code>$typography_key</code>",
					'<code>block.json</code>',
					"<code>supports.$typography_key</code>",
					"<code>supports.typography.$typography_key</code>"
				),
				'5.8.0'
			);

			_wp_array_set( $metadata['supports'], array( 'typography', $typography_key ), $support_for_key );
			unset( $metadata['supports'][ $typography_key ] );
		}
	}

	return $metadata;
}
```

## История изменений

- 5.8.0 — Introduced.

## Связанные

Использует: [`_wp_array_set`](https://chugunov.pro/api-wordpress/functions/_wp_array_set/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`_doing_it_wrong`](https://chugunov.pro/api-wordpress/functions/_doing_it_wrong/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_migrate_old_typography_shape/
