On this page
WP_Theme_JSON_Schema::rename_paths( array $settings, array $paths_to_rename ): array
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Processes the settings subtree.
Parameters
$settingsarray Required-
Array to process.
$paths_to_renamearray Required-
Paths to rename.
Return
array The settings in the new format.
Source
File: wp-includes/class-wp-theme-json-schema.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Theme_JSON_Schema::rename_settings() wp-includes/class-wp-theme-json-schema.php | Processes a settings array, renaming or moving properties. |
Used By
| Used By | Description |
|---|---|
| WP_Theme_JSON_Schema::migrate_v1_to_v2() wp-includes/class-wp-theme-json-schema.php | Removes the custom prefixes for a few properties that were part of v1: |
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json_schema/rename_paths