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.


Top ↑

Return

(array) The settings in the new format.


Top ↑

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;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.