Changeset 59328 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 10/30/2024 11:50:03 PM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r59262 r59328 228 228 * @since 6.6.0 Added `background-[image|position|repeat|size]` properties. 229 229 * @since 6.7.0 Added `background-attachment` property. 230 *231 230 * @var array 232 231 */ … … 308 307 * @since 6.2.0 309 308 * @since 6.6.0 Added background-image properties. 310 *311 309 * @var array 312 310 */ … … 340 338 * 341 339 * @since 5.9.0 340 * @var array 342 341 */ 343 342 const PROTECTED_PROPERTIES = array( … … 476 475 * 477 476 * @since 6.5.0 478 *479 477 * @var array 480 478 */ … … 518 516 * @since 6.5.0 Added support for `dimensions.aspectRatio`. 519 517 * @since 6.6.0 Added `background` sub properties to top-level only. 520 *521 518 * @var array 522 519 */ … … 592 589 * @since 6.1.0 593 590 * @since 6.2.0 Added support for ':link' and ':any-link'. 591 * @var array 594 592 */ 595 593 const VALID_ELEMENT_PSEUDO_SELECTORS = array( … … 939 937 */ 940 938 protected static function sanitize( $input, $valid_block_names, $valid_element_names, $valid_variations ) { 941 942 939 $output = array(); 943 940 … … 2312 2309 * @param string $selector The style block selector. 2313 2310 * @param boolean $use_root_padding Whether to add custom properties at root level. 2314 * @return array 2311 * @return array Returns the modified $declarations. 2315 2312 */ 2316 2313 protected static function compute_style_properties( $styles, $settings = array(), $properties = null, $theme_json = null, $selector = null, $use_root_padding = null ) { … … 2816 2813 * 2817 2814 * @param array $block_metadata Metadata about the block to get styles for. 2818 *2819 2815 * @return string Styles for the block. 2820 2816 */ … … 3041 3037 3042 3038 /* 3043 * If there are content and wide widths in theme.json, output them3044 * as custom properties on the body element so all blocks can use them.3045 */3039 * If there are content and wide widths in theme.json, output them 3040 * as custom properties on the body element so all blocks can use them. 3041 */ 3046 3042 if ( isset( $settings['layout']['contentSize'] ) || isset( $settings['layout']['wideSize'] ) ) { 3047 3043 $content_size = isset( $settings['layout']['contentSize'] ) ? $settings['layout']['contentSize'] : $settings['layout']['wideSize']; … … 3054 3050 3055 3051 /* 3056 * Reset default browser margin on the body element.3057 * This is set on the body selector **before** generating the ruleset3058 * from the `theme.json`. This is to ensure that if the `theme.json` declares3059 * `margin` in its `spacing` declaration for the `body` element then these3060 * user-generated values take precedence in the CSS cascade.3061 * @link https://github.com/WordPress/gutenberg/issues/36147.3062 */3052 * Reset default browser margin on the body element. 3053 * This is set on the body selector **before** generating the ruleset 3054 * from the `theme.json`. This is to ensure that if the `theme.json` declares 3055 * `margin` in its `spacing` declaration for the `body` element then these 3056 * user-generated values take precedence in the CSS cascade. 3057 * @link https://github.com/WordPress/gutenberg/issues/36147. 3058 */ 3063 3059 $css .= ':where(body) { margin: 0; }'; 3064 3060 … … 3470 3466 * 3471 3467 * @param array $theme_json Structure to sanitize. 3472 * @param string $origin Optional. What source of data this object represents.3473 * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'.3468 * @param string $origin Optional. What source of data this object represents. 3469 * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'. 3474 3470 * @return array Sanitized structure. 3475 3471 */ … … 4203 4199 * 4204 4200 * @since 6.3.0 4201 * 4205 4202 * @param string $value The variable such as var:preset|color|vivid-green-cyan to convert. 4206 4203 * @return string The converted variable. … … 4228 4225 * 4229 4226 * @since 6.3.0 4230 * @param array $tree Input to process. 4227 * 4228 * @param array $tree Input to process. 4231 4229 * @return array The modified $tree. 4232 4230 */ … … 4252 4250 * @param object $block_type The block type. 4253 4251 * @param string $root_selector The block's root selector. 4254 *4255 4252 * @return array The custom selectors set by the block. 4256 4253 */ … … 4311 4308 * @param object $metadata The related block metadata containing selectors. 4312 4309 * @param object $node A merged theme.json node for block or variation. 4313 *4314 4310 * @return array The style declarations for the node's features with custom 4315 * selectors.4311 * selectors. 4316 4312 */ 4317 4313 protected function get_feature_declarations_for_node( $metadata, &$node ) { … … 4471 4467 * 4472 4468 * @since 6.3.0 4469 * 4473 4470 * @param WP_Theme_JSON $theme_json The theme json resolver. 4474 *4475 4471 * @return WP_Theme_JSON The $theme_json with resolved variables. 4476 4472 */
Note: See TracChangeset
for help on using the changeset viewer.