[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-theme-json-schema.php (summary)

WP_Theme_JSON_Schema class

File Size: 152 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Theme_JSON_Schema:: (5 methods):
  migrate()
  migrate_v1_to_v2()
  rename_paths()
  rename_settings()
  unset_setting_by_path()


Class: WP_Theme_JSON_Schema  - X-Ref

Class that migrates a given theme.json structure to the latest schema.

This class is for internal core usage and is not supposed to be used by extenders (plugins and/or themes).
This is a low-level API that may need to do breaking changes. Please,
use get_global_settings, get_global_styles, and get_global_stylesheet instead.

migrate( $theme_json )   X-Ref
Function that migrates a given theme.json structure to the last version.

param: array $theme_json The structure to migrate.
return: array The structure in the last version.
since: 5.9.0

migrate_v1_to_v2( $old )   X-Ref
Removes the custom prefixes for a few properties
that were part of v1:

'border.customRadius'         => 'border.radius',
'spacing.customMargin'        => 'spacing.margin',
'spacing.customPadding'       => 'spacing.padding',
'typography.customLineHeight' => 'typography.lineHeight',

param: array $old Data to migrate.
return: array Data without the custom prefixes.
since: 5.9.0

rename_paths( $settings, $paths_to_rename )   X-Ref
Processes the settings subtree.

param: array $settings        Array to process.
param: array $paths_to_rename Paths to rename.
return: array The settings in the new format.
since: 5.9.0

rename_settings( &$settings, $paths_to_rename )   X-Ref
Processes a settings array, renaming or moving properties.

param: array $settings        Reference to settings either defaults or an individual block's.
param: array $paths_to_rename Paths to rename.
since: 5.9.0

unset_setting_by_path( &$settings, $path )   X-Ref
Removes a property from within the provided settings by its path.

param: array $settings Reference to the current settings array.
param: array $path Path to the property to be removed.
return: void
since: 5.9.0



Generated: Sun Dec 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1