WP_Theme_JSON_Schema::rename_paths
Processes the settings subtree.
Method of the class: WP_Theme_JSON_Schema{}
No Hooks.
Returns
Array. The settings in the new format.
Usage
$result = WP_Theme_JSON_Schema::rename_paths( $settings, $paths_to_rename );
- $settings(array) (required)
- Array to process.
- $paths_to_rename(array) (required)
- Paths to rename.
Changelog
| Since 5.9.0 | Introduced. |
WP_Theme_JSON_Schema::rename_paths() WP Theme JSON Schema::rename paths code WP 6.9.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;
}