WP_Theme_JSON_Schema::migrate() – Function that migrates a given theme.json structure to the last version.
You appear to be a bot. Output may be restricted
Description
Function that migrates a given theme.json structure to the last version.
Usage
$array = WP_Theme_JSON_Schema::migrate( $theme_json );
Parameters
- $theme_json
- ( array ) required – The structure to migrate.
Returns
array The structure in the last version.
Source
File name: wordpress/wp-includes/class-wp-theme-json-schema.php
Lines:
1 to 13 of 13
public static function migrate( $theme_json ) { if ( ! isset( $theme_json['version'] ) ) { $theme_json = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA, ); } if ( 1 === $theme_json['version'] ) { $theme_json = self::migrate_v1_to_v2( $theme_json ); } return $theme_json; }