Alert: 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.
WP_Theme_JSON_Schema::rename_paths() WordPress Method
The WP_Theme_JSON_Schema::rename_paths() method is used to rename paths in a JSON file. This is useful when you need to change the location of a theme or plugin.
WP_Theme_JSON_Schema::rename_paths( array $settings, array $paths_to_rename ) #
Processes the settings subtree.
Parameters
- $settings
(array)(Required)Array to process.
- $paths_to_rename
(array)(Required)Paths to rename.
Return
(array) The settings in the new format.
Source
File: wp-includes/class-wp-theme-json-schema.php
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; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |