WP_Theme_JSON_Schema::rename_paths()private staticWP 5.9.0

Processes the settings subtree.

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

Хуков нет.

Возвращает

Массив. The settings in the new format.

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

$result = WP_Theme_JSON_Schema::rename_paths( $settings, $paths_to_rename );
$settings(массив) (обязательный)
Array to process.
$paths_to_rename(массив) (обязательный)
Paths to rename.

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

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

Код WP_Theme_JSON_Schema::rename_paths() WP 6.0.1

private static function rename_paths( $settings, $paths_to_rename ) {
	$new_settings = $settings;

	// Process any renamed/moved paths within default settings.
	self::rename_settings( $new_settings, $paths_to_rename );

	// Process individual block settings.
	if ( isset( $new_settings['blocks'] ) && is_array( $new_settings['blocks'] ) ) {
		foreach ( $new_settings['blocks'] as &$block_settings ) {
			self::rename_settings( $block_settings, $paths_to_rename );
		}
	}

	return $new_settings;
}