Edit File by line
/home/zeestwma/richards.../wp-inclu...
File: class-wp-theme-json.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WP_Theme_JSON class
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Theme
[5] Fix | Delete
* @since 5.8.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Class that encapsulates the processing of structures that adhere to the theme.json spec.
[10] Fix | Delete
*
[11] Fix | Delete
* This class is for internal core usage and is not supposed to be used by extenders (plugins and/or themes).
[12] Fix | Delete
* This is a low-level API that may need to do breaking changes. Please,
[13] Fix | Delete
* use get_global_settings, get_global_styles, and get_global_stylesheet instead.
[14] Fix | Delete
*
[15] Fix | Delete
* @access private
[16] Fix | Delete
*/
[17] Fix | Delete
#[AllowDynamicProperties]
[18] Fix | Delete
class WP_Theme_JSON {
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Container of data in theme.json format.
[22] Fix | Delete
*
[23] Fix | Delete
* @since 5.8.0
[24] Fix | Delete
* @var array
[25] Fix | Delete
*/
[26] Fix | Delete
protected $theme_json = null;
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Holds block metadata extracted from block.json
[30] Fix | Delete
* to be shared among all instances so we don't
[31] Fix | Delete
* process it twice.
[32] Fix | Delete
*
[33] Fix | Delete
* @since 5.8.0
[34] Fix | Delete
* @since 6.1.0 Initialize as an empty array.
[35] Fix | Delete
* @var array
[36] Fix | Delete
*/
[37] Fix | Delete
protected static $blocks_metadata = array();
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* The CSS selector for the top-level preset settings.
[41] Fix | Delete
*
[42] Fix | Delete
* @since 6.6.0
[43] Fix | Delete
* @var string
[44] Fix | Delete
*/
[45] Fix | Delete
const ROOT_CSS_PROPERTIES_SELECTOR = ':root';
[46] Fix | Delete
[47] Fix | Delete
/**
[48] Fix | Delete
* The CSS selector for the top-level styles.
[49] Fix | Delete
*
[50] Fix | Delete
* @since 5.8.0
[51] Fix | Delete
* @var string
[52] Fix | Delete
*/
[53] Fix | Delete
const ROOT_BLOCK_SELECTOR = 'body';
[54] Fix | Delete
[55] Fix | Delete
/**
[56] Fix | Delete
* The sources of data this object can represent.
[57] Fix | Delete
*
[58] Fix | Delete
* @since 5.8.0
[59] Fix | Delete
* @since 6.1.0 Added 'blocks'.
[60] Fix | Delete
* @var string[]
[61] Fix | Delete
*/
[62] Fix | Delete
const VALID_ORIGINS = array(
[63] Fix | Delete
'default',
[64] Fix | Delete
'blocks',
[65] Fix | Delete
'theme',
[66] Fix | Delete
'custom',
[67] Fix | Delete
);
[68] Fix | Delete
[69] Fix | Delete
/**
[70] Fix | Delete
* Presets are a set of values that serve
[71] Fix | Delete
* to bootstrap some styles: colors, font sizes, etc.
[72] Fix | Delete
*
[73] Fix | Delete
* They are a unkeyed array of values such as:
[74] Fix | Delete
*
[75] Fix | Delete
* array(
[76] Fix | Delete
* array(
[77] Fix | Delete
* 'slug' => 'unique-name-within-the-set',
[78] Fix | Delete
* 'name' => 'Name for the UI',
[79] Fix | Delete
* <value_key> => 'value'
[80] Fix | Delete
* ),
[81] Fix | Delete
* )
[82] Fix | Delete
*
[83] Fix | Delete
* This contains the necessary metadata to process them:
[84] Fix | Delete
*
[85] Fix | Delete
* - path => Where to find the preset within the settings section.
[86] Fix | Delete
* - prevent_override => Disables override of default presets by theme presets.
[87] Fix | Delete
* The relationship between whether to override the defaults
[88] Fix | Delete
* and whether the defaults are enabled is inverse:
[89] Fix | Delete
* - If defaults are enabled => theme presets should not be overridden
[90] Fix | Delete
* - If defaults are disabled => theme presets should be overridden
[91] Fix | Delete
* For example, a theme sets defaultPalette to false,
[92] Fix | Delete
* making the default palette hidden from the user.
[93] Fix | Delete
* In that case, we want all the theme presets to be present,
[94] Fix | Delete
* so they should override the defaults by setting this false.
[95] Fix | Delete
* - use_default_names => whether to use the default names
[96] Fix | Delete
* - value_key => the key that represents the value
[97] Fix | Delete
* - value_func => optionally, instead of value_key, a function to generate
[98] Fix | Delete
* the value that takes a preset as an argument
[99] Fix | Delete
* (either value_key or value_func should be present)
[100] Fix | Delete
* - css_vars => template string to use in generating the CSS Custom Property.
[101] Fix | Delete
* Example output: "--wp--preset--duotone--blue: <value>" will generate as many CSS Custom Properties as presets defined
[102] Fix | Delete
* substituting the $slug for the slug's value for each preset value.
[103] Fix | Delete
* - classes => array containing a structure with the classes to
[104] Fix | Delete
* generate for the presets, where for each array item
[105] Fix | Delete
* the key is the class name and the value the property name.
[106] Fix | Delete
* The "$slug" substring will be replaced by the slug of each preset.
[107] Fix | Delete
* For example:
[108] Fix | Delete
* 'classes' => array(
[109] Fix | Delete
* '.has-$slug-color' => 'color',
[110] Fix | Delete
* '.has-$slug-background-color' => 'background-color',
[111] Fix | Delete
* '.has-$slug-border-color' => 'border-color',
[112] Fix | Delete
* )
[113] Fix | Delete
* - properties => array of CSS properties to be used by kses to
[114] Fix | Delete
* validate the content of each preset
[115] Fix | Delete
* by means of the remove_insecure_properties method.
[116] Fix | Delete
*
[117] Fix | Delete
* @since 5.8.0
[118] Fix | Delete
* @since 5.9.0 Added the `color.duotone` and `typography.fontFamilies` presets,
[119] Fix | Delete
* `use_default_names` preset key, and simplified the metadata structure.
[120] Fix | Delete
* @since 6.0.0 Replaced `override` with `prevent_override` and updated the
[121] Fix | Delete
* `prevent_override` value for `color.duotone` to use `color.defaultDuotone`.
[122] Fix | Delete
* @since 6.2.0 Added 'shadow' presets.
[123] Fix | Delete
* @since 6.3.0 Replaced value_func for duotone with `null`. Custom properties are handled by class-wp-duotone.php.
[124] Fix | Delete
* @since 6.6.0 Added the `dimensions.aspectRatios` and `dimensions.defaultAspectRatios` presets.
[125] Fix | Delete
* Updated the 'prevent_override' value for font size presets to use 'typography.defaultFontSizes'
[126] Fix | Delete
* and spacing size presets to use `spacing.defaultSpacingSizes`.
[127] Fix | Delete
* @var array
[128] Fix | Delete
*/
[129] Fix | Delete
const PRESETS_METADATA = array(
[130] Fix | Delete
array(
[131] Fix | Delete
'path' => array( 'dimensions', 'aspectRatios' ),
[132] Fix | Delete
'prevent_override' => array( 'dimensions', 'defaultAspectRatios' ),
[133] Fix | Delete
'use_default_names' => false,
[134] Fix | Delete
'value_key' => 'ratio',
[135] Fix | Delete
'css_vars' => '--wp--preset--aspect-ratio--$slug',
[136] Fix | Delete
'classes' => array(),
[137] Fix | Delete
'properties' => array( 'aspect-ratio' ),
[138] Fix | Delete
),
[139] Fix | Delete
array(
[140] Fix | Delete
'path' => array( 'color', 'palette' ),
[141] Fix | Delete
'prevent_override' => array( 'color', 'defaultPalette' ),
[142] Fix | Delete
'use_default_names' => false,
[143] Fix | Delete
'value_key' => 'color',
[144] Fix | Delete
'css_vars' => '--wp--preset--color--$slug',
[145] Fix | Delete
'classes' => array(
[146] Fix | Delete
'.has-$slug-color' => 'color',
[147] Fix | Delete
'.has-$slug-background-color' => 'background-color',
[148] Fix | Delete
'.has-$slug-border-color' => 'border-color',
[149] Fix | Delete
),
[150] Fix | Delete
'properties' => array( 'color', 'background-color', 'border-color' ),
[151] Fix | Delete
),
[152] Fix | Delete
array(
[153] Fix | Delete
'path' => array( 'color', 'gradients' ),
[154] Fix | Delete
'prevent_override' => array( 'color', 'defaultGradients' ),
[155] Fix | Delete
'use_default_names' => false,
[156] Fix | Delete
'value_key' => 'gradient',
[157] Fix | Delete
'css_vars' => '--wp--preset--gradient--$slug',
[158] Fix | Delete
'classes' => array( '.has-$slug-gradient-background' => 'background' ),
[159] Fix | Delete
'properties' => array( 'background' ),
[160] Fix | Delete
),
[161] Fix | Delete
array(
[162] Fix | Delete
'path' => array( 'color', 'duotone' ),
[163] Fix | Delete
'prevent_override' => array( 'color', 'defaultDuotone' ),
[164] Fix | Delete
'use_default_names' => false,
[165] Fix | Delete
'value_func' => null, // CSS Custom Properties for duotone are handled by block supports in class-wp-duotone.php.
[166] Fix | Delete
'css_vars' => null,
[167] Fix | Delete
'classes' => array(),
[168] Fix | Delete
'properties' => array( 'filter' ),
[169] Fix | Delete
),
[170] Fix | Delete
array(
[171] Fix | Delete
'path' => array( 'typography', 'fontSizes' ),
[172] Fix | Delete
'prevent_override' => array( 'typography', 'defaultFontSizes' ),
[173] Fix | Delete
'use_default_names' => true,
[174] Fix | Delete
'value_func' => 'wp_get_typography_font_size_value',
[175] Fix | Delete
'css_vars' => '--wp--preset--font-size--$slug',
[176] Fix | Delete
'classes' => array( '.has-$slug-font-size' => 'font-size' ),
[177] Fix | Delete
'properties' => array( 'font-size' ),
[178] Fix | Delete
),
[179] Fix | Delete
array(
[180] Fix | Delete
'path' => array( 'typography', 'fontFamilies' ),
[181] Fix | Delete
'prevent_override' => false,
[182] Fix | Delete
'use_default_names' => false,
[183] Fix | Delete
'value_key' => 'fontFamily',
[184] Fix | Delete
'css_vars' => '--wp--preset--font-family--$slug',
[185] Fix | Delete
'classes' => array( '.has-$slug-font-family' => 'font-family' ),
[186] Fix | Delete
'properties' => array( 'font-family' ),
[187] Fix | Delete
),
[188] Fix | Delete
array(
[189] Fix | Delete
'path' => array( 'spacing', 'spacingSizes' ),
[190] Fix | Delete
'prevent_override' => array( 'spacing', 'defaultSpacingSizes' ),
[191] Fix | Delete
'use_default_names' => true,
[192] Fix | Delete
'value_key' => 'size',
[193] Fix | Delete
'css_vars' => '--wp--preset--spacing--$slug',
[194] Fix | Delete
'classes' => array(),
[195] Fix | Delete
'properties' => array( 'padding', 'margin' ),
[196] Fix | Delete
),
[197] Fix | Delete
array(
[198] Fix | Delete
'path' => array( 'shadow', 'presets' ),
[199] Fix | Delete
'prevent_override' => array( 'shadow', 'defaultPresets' ),
[200] Fix | Delete
'use_default_names' => false,
[201] Fix | Delete
'value_key' => 'shadow',
[202] Fix | Delete
'css_vars' => '--wp--preset--shadow--$slug',
[203] Fix | Delete
'classes' => array(),
[204] Fix | Delete
'properties' => array( 'box-shadow' ),
[205] Fix | Delete
),
[206] Fix | Delete
);
[207] Fix | Delete
[208] Fix | Delete
/**
[209] Fix | Delete
* Metadata for style properties.
[210] Fix | Delete
*
[211] Fix | Delete
* Each element is a direct mapping from the CSS property name to the
[212] Fix | Delete
* path to the value in theme.json & block attributes.
[213] Fix | Delete
*
[214] Fix | Delete
* @since 5.8.0
[215] Fix | Delete
* @since 5.9.0 Added the `border-*`, `font-family`, `font-style`, `font-weight`,
[216] Fix | Delete
* `letter-spacing`, `margin-*`, `padding-*`, `--wp--style--block-gap`,
[217] Fix | Delete
* `text-decoration`, `text-transform`, and `filter` properties,
[218] Fix | Delete
* simplified the metadata structure.
[219] Fix | Delete
* @since 6.1.0 Added the `border-*-color`, `border-*-width`, `border-*-style`,
[220] Fix | Delete
* `--wp--style--root--padding-*`, and `box-shadow` properties,
[221] Fix | Delete
* removed the `--wp--style--block-gap` property.
[222] Fix | Delete
* @since 6.2.0 Added `outline-*`, and `min-height` properties.
[223] Fix | Delete
* @since 6.3.0 Added `column-count` property.
[224] Fix | Delete
* @since 6.4.0 Added `writing-mode` property.
[225] Fix | Delete
* @since 6.5.0 Added `aspect-ratio` property.
[226] Fix | Delete
* @since 6.6.0 Added `background-[image|position|repeat|size]` properties.
[227] Fix | Delete
*
[228] Fix | Delete
* @var array
[229] Fix | Delete
*/
[230] Fix | Delete
const PROPERTIES_METADATA = array(
[231] Fix | Delete
'aspect-ratio' => array( 'dimensions', 'aspectRatio' ),
[232] Fix | Delete
'background' => array( 'color', 'gradient' ),
[233] Fix | Delete
'background-color' => array( 'color', 'background' ),
[234] Fix | Delete
'background-image' => array( 'background', 'backgroundImage' ),
[235] Fix | Delete
'background-position' => array( 'background', 'backgroundPosition' ),
[236] Fix | Delete
'background-repeat' => array( 'background', 'backgroundRepeat' ),
[237] Fix | Delete
'background-size' => array( 'background', 'backgroundSize' ),
[238] Fix | Delete
'border-radius' => array( 'border', 'radius' ),
[239] Fix | Delete
'border-top-left-radius' => array( 'border', 'radius', 'topLeft' ),
[240] Fix | Delete
'border-top-right-radius' => array( 'border', 'radius', 'topRight' ),
[241] Fix | Delete
'border-bottom-left-radius' => array( 'border', 'radius', 'bottomLeft' ),
[242] Fix | Delete
'border-bottom-right-radius' => array( 'border', 'radius', 'bottomRight' ),
[243] Fix | Delete
'border-color' => array( 'border', 'color' ),
[244] Fix | Delete
'border-width' => array( 'border', 'width' ),
[245] Fix | Delete
'border-style' => array( 'border', 'style' ),
[246] Fix | Delete
'border-top-color' => array( 'border', 'top', 'color' ),
[247] Fix | Delete
'border-top-width' => array( 'border', 'top', 'width' ),
[248] Fix | Delete
'border-top-style' => array( 'border', 'top', 'style' ),
[249] Fix | Delete
'border-right-color' => array( 'border', 'right', 'color' ),
[250] Fix | Delete
'border-right-width' => array( 'border', 'right', 'width' ),
[251] Fix | Delete
'border-right-style' => array( 'border', 'right', 'style' ),
[252] Fix | Delete
'border-bottom-color' => array( 'border', 'bottom', 'color' ),
[253] Fix | Delete
'border-bottom-width' => array( 'border', 'bottom', 'width' ),
[254] Fix | Delete
'border-bottom-style' => array( 'border', 'bottom', 'style' ),
[255] Fix | Delete
'border-left-color' => array( 'border', 'left', 'color' ),
[256] Fix | Delete
'border-left-width' => array( 'border', 'left', 'width' ),
[257] Fix | Delete
'border-left-style' => array( 'border', 'left', 'style' ),
[258] Fix | Delete
'color' => array( 'color', 'text' ),
[259] Fix | Delete
'text-align' => array( 'typography', 'textAlign' ),
[260] Fix | Delete
'column-count' => array( 'typography', 'textColumns' ),
[261] Fix | Delete
'font-family' => array( 'typography', 'fontFamily' ),
[262] Fix | Delete
'font-size' => array( 'typography', 'fontSize' ),
[263] Fix | Delete
'font-style' => array( 'typography', 'fontStyle' ),
[264] Fix | Delete
'font-weight' => array( 'typography', 'fontWeight' ),
[265] Fix | Delete
'letter-spacing' => array( 'typography', 'letterSpacing' ),
[266] Fix | Delete
'line-height' => array( 'typography', 'lineHeight' ),
[267] Fix | Delete
'margin' => array( 'spacing', 'margin' ),
[268] Fix | Delete
'margin-top' => array( 'spacing', 'margin', 'top' ),
[269] Fix | Delete
'margin-right' => array( 'spacing', 'margin', 'right' ),
[270] Fix | Delete
'margin-bottom' => array( 'spacing', 'margin', 'bottom' ),
[271] Fix | Delete
'margin-left' => array( 'spacing', 'margin', 'left' ),
[272] Fix | Delete
'min-height' => array( 'dimensions', 'minHeight' ),
[273] Fix | Delete
'outline-color' => array( 'outline', 'color' ),
[274] Fix | Delete
'outline-offset' => array( 'outline', 'offset' ),
[275] Fix | Delete
'outline-style' => array( 'outline', 'style' ),
[276] Fix | Delete
'outline-width' => array( 'outline', 'width' ),
[277] Fix | Delete
'padding' => array( 'spacing', 'padding' ),
[278] Fix | Delete
'padding-top' => array( 'spacing', 'padding', 'top' ),
[279] Fix | Delete
'padding-right' => array( 'spacing', 'padding', 'right' ),
[280] Fix | Delete
'padding-bottom' => array( 'spacing', 'padding', 'bottom' ),
[281] Fix | Delete
'padding-left' => array( 'spacing', 'padding', 'left' ),
[282] Fix | Delete
'--wp--style--root--padding' => array( 'spacing', 'padding' ),
[283] Fix | Delete
'--wp--style--root--padding-top' => array( 'spacing', 'padding', 'top' ),
[284] Fix | Delete
'--wp--style--root--padding-right' => array( 'spacing', 'padding', 'right' ),
[285] Fix | Delete
'--wp--style--root--padding-bottom' => array( 'spacing', 'padding', 'bottom' ),
[286] Fix | Delete
'--wp--style--root--padding-left' => array( 'spacing', 'padding', 'left' ),
[287] Fix | Delete
'text-decoration' => array( 'typography', 'textDecoration' ),
[288] Fix | Delete
'text-transform' => array( 'typography', 'textTransform' ),
[289] Fix | Delete
'filter' => array( 'filter', 'duotone' ),
[290] Fix | Delete
'box-shadow' => array( 'shadow' ),
[291] Fix | Delete
'writing-mode' => array( 'typography', 'writingMode' ),
[292] Fix | Delete
);
[293] Fix | Delete
[294] Fix | Delete
/**
[295] Fix | Delete
* Indirect metadata for style properties that are not directly output.
[296] Fix | Delete
*
[297] Fix | Delete
* Each element maps from a CSS property name to an array of
[298] Fix | Delete
* paths to the value in theme.json & block attributes.
[299] Fix | Delete
*
[300] Fix | Delete
* Indirect properties are not output directly by `compute_style_properties`,
[301] Fix | Delete
* but are used elsewhere in the processing of global styles. The indirect
[302] Fix | Delete
* property is used to validate whether a style value is allowed.
[303] Fix | Delete
*
[304] Fix | Delete
* @since 6.2.0
[305] Fix | Delete
* @since 6.6.0 Added background-image properties.
[306] Fix | Delete
*
[307] Fix | Delete
* @var array
[308] Fix | Delete
*/
[309] Fix | Delete
const INDIRECT_PROPERTIES_METADATA = array(
[310] Fix | Delete
'gap' => array(
[311] Fix | Delete
array( 'spacing', 'blockGap' ),
[312] Fix | Delete
),
[313] Fix | Delete
'column-gap' => array(
[314] Fix | Delete
array( 'spacing', 'blockGap', 'left' ),
[315] Fix | Delete
),
[316] Fix | Delete
'row-gap' => array(
[317] Fix | Delete
array( 'spacing', 'blockGap', 'top' ),
[318] Fix | Delete
),
[319] Fix | Delete
'max-width' => array(
[320] Fix | Delete
array( 'layout', 'contentSize' ),
[321] Fix | Delete
array( 'layout', 'wideSize' ),
[322] Fix | Delete
),
[323] Fix | Delete
'background-image' => array(
[324] Fix | Delete
array( 'background', 'backgroundImage', 'url' ),
[325] Fix | Delete
),
[326] Fix | Delete
);
[327] Fix | Delete
[328] Fix | Delete
/**
[329] Fix | Delete
* Protected style properties.
[330] Fix | Delete
*
[331] Fix | Delete
* These style properties are only rendered if a setting enables it
[332] Fix | Delete
* via a value other than `null`.
[333] Fix | Delete
*
[334] Fix | Delete
* Each element maps the style property to the corresponding theme.json
[335] Fix | Delete
* setting key.
[336] Fix | Delete
*
[337] Fix | Delete
* @since 5.9.0
[338] Fix | Delete
*/
[339] Fix | Delete
const PROTECTED_PROPERTIES = array(
[340] Fix | Delete
'spacing.blockGap' => array( 'spacing', 'blockGap' ),
[341] Fix | Delete
);
[342] Fix | Delete
[343] Fix | Delete
/**
[344] Fix | Delete
* The top-level keys a theme.json can have.
[345] Fix | Delete
*
[346] Fix | Delete
* @since 5.8.0 As `ALLOWED_TOP_LEVEL_KEYS`.
[347] Fix | Delete
* @since 5.9.0 Renamed from `ALLOWED_TOP_LEVEL_KEYS` to `VALID_TOP_LEVEL_KEYS`,
[348] Fix | Delete
* added the `customTemplates` and `templateParts` values.
[349] Fix | Delete
* @since 6.3.0 Added the `description` value.
[350] Fix | Delete
* @since 6.6.0 Added `blockTypes` to support block style variation theme.json partials.
[351] Fix | Delete
* @var string[]
[352] Fix | Delete
*/
[353] Fix | Delete
const VALID_TOP_LEVEL_KEYS = array(
[354] Fix | Delete
'blockTypes',
[355] Fix | Delete
'customTemplates',
[356] Fix | Delete
'description',
[357] Fix | Delete
'patterns',
[358] Fix | Delete
'settings',
[359] Fix | Delete
'slug',
[360] Fix | Delete
'styles',
[361] Fix | Delete
'templateParts',
[362] Fix | Delete
'title',
[363] Fix | Delete
'version',
[364] Fix | Delete
);
[365] Fix | Delete
[366] Fix | Delete
/**
[367] Fix | Delete
* The valid properties under the settings key.
[368] Fix | Delete
*
[369] Fix | Delete
* @since 5.8.0 As `ALLOWED_SETTINGS`.
[370] Fix | Delete
* @since 5.9.0 Renamed from `ALLOWED_SETTINGS` to `VALID_SETTINGS`,
[371] Fix | Delete
* added new properties for `border`, `color`, `spacing`,
[372] Fix | Delete
* and `typography`, and renamed others according to the new schema.
[373] Fix | Delete
* @since 6.0.0 Added `color.defaultDuotone`.
[374] Fix | Delete
* @since 6.1.0 Added `layout.definitions` and `useRootPaddingAwareAlignments`.
[375] Fix | Delete
* @since 6.2.0 Added `dimensions.minHeight`, 'shadow.presets', 'shadow.defaultPresets',
[376] Fix | Delete
* `position.fixed` and `position.sticky`.
[377] Fix | Delete
* @since 6.3.0 Added support for `typography.textColumns`, removed `layout.definitions`.
[378] Fix | Delete
* @since 6.4.0 Added support for `layout.allowEditing`, `background.backgroundImage`,
[379] Fix | Delete
* `typography.writingMode`, `lightbox.enabled` and `lightbox.allowEditing`.
[380] Fix | Delete
* @since 6.5.0 Added support for `layout.allowCustomContentAndWideSize`,
[381] Fix | Delete
* `background.backgroundSize` and `dimensions.aspectRatio`.
[382] Fix | Delete
* @since 6.6.0 Added support for 'dimensions.aspectRatios', 'dimensions.defaultAspectRatios',
[383] Fix | Delete
* 'typography.defaultFontSizes', and 'spacing.defaultSpacingSizes'.
[384] Fix | Delete
* @var array
[385] Fix | Delete
*/
[386] Fix | Delete
const VALID_SETTINGS = array(
[387] Fix | Delete
'appearanceTools' => null,
[388] Fix | Delete
'useRootPaddingAwareAlignments' => null,
[389] Fix | Delete
'background' => array(
[390] Fix | Delete
'backgroundImage' => null,
[391] Fix | Delete
'backgroundSize' => null,
[392] Fix | Delete
),
[393] Fix | Delete
'border' => array(
[394] Fix | Delete
'color' => null,
[395] Fix | Delete
'radius' => null,
[396] Fix | Delete
'style' => null,
[397] Fix | Delete
'width' => null,
[398] Fix | Delete
),
[399] Fix | Delete
'color' => array(
[400] Fix | Delete
'background' => null,
[401] Fix | Delete
'custom' => null,
[402] Fix | Delete
'customDuotone' => null,
[403] Fix | Delete
'customGradient' => null,
[404] Fix | Delete
'defaultDuotone' => null,
[405] Fix | Delete
'defaultGradients' => null,
[406] Fix | Delete
'defaultPalette' => null,
[407] Fix | Delete
'duotone' => null,
[408] Fix | Delete
'gradients' => null,
[409] Fix | Delete
'link' => null,
[410] Fix | Delete
'heading' => null,
[411] Fix | Delete
'button' => null,
[412] Fix | Delete
'caption' => null,
[413] Fix | Delete
'palette' => null,
[414] Fix | Delete
'text' => null,
[415] Fix | Delete
),
[416] Fix | Delete
'custom' => null,
[417] Fix | Delete
'dimensions' => array(
[418] Fix | Delete
'aspectRatio' => null,
[419] Fix | Delete
'aspectRatios' => null,
[420] Fix | Delete
'defaultAspectRatios' => null,
[421] Fix | Delete
'minHeight' => null,
[422] Fix | Delete
),
[423] Fix | Delete
'layout' => array(
[424] Fix | Delete
'contentSize' => null,
[425] Fix | Delete
'wideSize' => null,
[426] Fix | Delete
'allowEditing' => null,
[427] Fix | Delete
'allowCustomContentAndWideSize' => null,
[428] Fix | Delete
),
[429] Fix | Delete
'lightbox' => array(
[430] Fix | Delete
'enabled' => null,
[431] Fix | Delete
'allowEditing' => null,
[432] Fix | Delete
),
[433] Fix | Delete
'position' => array(
[434] Fix | Delete
'fixed' => null,
[435] Fix | Delete
'sticky' => null,
[436] Fix | Delete
),
[437] Fix | Delete
'spacing' => array(
[438] Fix | Delete
'customSpacingSize' => null,
[439] Fix | Delete
'defaultSpacingSizes' => null,
[440] Fix | Delete
'spacingSizes' => null,
[441] Fix | Delete
'spacingScale' => null,
[442] Fix | Delete
'blockGap' => null,
[443] Fix | Delete
'margin' => null,
[444] Fix | Delete
'padding' => null,
[445] Fix | Delete
'units' => null,
[446] Fix | Delete
),
[447] Fix | Delete
'shadow' => array(
[448] Fix | Delete
'presets' => null,
[449] Fix | Delete
'defaultPresets' => null,
[450] Fix | Delete
),
[451] Fix | Delete
'typography' => array(
[452] Fix | Delete
'fluid' => null,
[453] Fix | Delete
'customFontSize' => null,
[454] Fix | Delete
'defaultFontSizes' => null,
[455] Fix | Delete
'dropCap' => null,
[456] Fix | Delete
'fontFamilies' => null,
[457] Fix | Delete
'fontSizes' => null,
[458] Fix | Delete
'fontStyle' => null,
[459] Fix | Delete
'fontWeight' => null,
[460] Fix | Delete
'letterSpacing' => null,
[461] Fix | Delete
'lineHeight' => null,
[462] Fix | Delete
'textAlign' => null,
[463] Fix | Delete
'textColumns' => null,
[464] Fix | Delete
'textDecoration' => null,
[465] Fix | Delete
'textTransform' => null,
[466] Fix | Delete
'writingMode' => null,
[467] Fix | Delete
),
[468] Fix | Delete
);
[469] Fix | Delete
[470] Fix | Delete
/*
[471] Fix | Delete
* The valid properties for fontFamilies under settings key.
[472] Fix | Delete
*
[473] Fix | Delete
* @since 6.5.0
[474] Fix | Delete
*
[475] Fix | Delete
* @var array
[476] Fix | Delete
*/
[477] Fix | Delete
const FONT_FAMILY_SCHEMA = array(
[478] Fix | Delete
array(
[479] Fix | Delete
'fontFamily' => null,
[480] Fix | Delete
'name' => null,
[481] Fix | Delete
'slug' => null,
[482] Fix | Delete
'fontFace' => array(
[483] Fix | Delete
array(
[484] Fix | Delete
'ascentOverride' => null,
[485] Fix | Delete
'descentOverride' => null,
[486] Fix | Delete
'fontDisplay' => null,
[487] Fix | Delete
'fontFamily' => null,
[488] Fix | Delete
'fontFeatureSettings' => null,
[489] Fix | Delete
'fontStyle' => null,
[490] Fix | Delete
'fontStretch' => null,
[491] Fix | Delete
'fontVariationSettings' => null,
[492] Fix | Delete
'fontWeight' => null,
[493] Fix | Delete
'lineGapOverride' => null,
[494] Fix | Delete
'sizeAdjust' => null,
[495] Fix | Delete
'src' => null,
[496] Fix | Delete
'unicodeRange' => null,
[497] Fix | Delete
),
[498] Fix | Delete
),
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function