WP_Theme_JSON_Schema::migrate_v1_to_v2()private staticWP 5.9.0

Removes the custom prefixes for a few properties that were part of v1:

'border.customRadius' => 'border.radius', 'spacing.customMargin' => 'spacing.margin', 'spacing.customPadding' => 'spacing.padding', 'typography.customLineHeight' => 'typography.lineHeight',

{} Это метод класса: WP_Theme_JSON_Schema{}

Хуков нет.

Возвращает

Массив. Data without the custom prefixes.

Использование

$result = WP_Theme_JSON_Schema::migrate_v1_to_v2( $old );
$old(массив) (обязательный)
Data to migrate.

Список изменений

С версии 5.9.0 Введена.

Код WP_Theme_JSON_Schema::migrate_v1_to_v2() WP 6.0.1

private static function migrate_v1_to_v2( $old ) {
	// Copy everything.
	$new = $old;

	// Overwrite the things that changed.
	if ( isset( $old['settings'] ) ) {
		$new['settings'] = self::rename_paths( $old['settings'], self::V1_TO_V2_RENAMED_PATHS );
	}

	// Set the new version.
	$new['version'] = 2;

	return $new;
}