Docs: Correct DocBlock formatting in wp-includes/class-wp-theme-json.php.

Follow-up to [52049], [54118], [54162], [55008], [55349], [55959], [55986], [56058], [57496], [58354], [58413].

Props mukesh27, ramonopoly.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59328


git-svn-id: http://core.svn.wordpress.org/trunk@58714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-10-30 23:52:17 +00:00
parent f17b845a78
commit 2a96d5f4e3
2 changed files with 21 additions and 25 deletions

View File

@ -227,7 +227,6 @@ class WP_Theme_JSON {
* @since 6.5.0 Added `aspect-ratio` property.
* @since 6.6.0 Added `background-[image|position|repeat|size]` properties.
* @since 6.7.0 Added `background-attachment` property.
*
* @var array
*/
const PROPERTIES_METADATA = array(
@ -307,7 +306,6 @@ class WP_Theme_JSON {
*
* @since 6.2.0
* @since 6.6.0 Added background-image properties.
*
* @var array
*/
const INDIRECT_PROPERTIES_METADATA = array(
@ -339,6 +337,7 @@ class WP_Theme_JSON {
* setting key.
*
* @since 5.9.0
* @var array
*/
const PROTECTED_PROPERTIES = array(
'spacing.blockGap' => array( 'spacing', 'blockGap' ),
@ -475,7 +474,6 @@ class WP_Theme_JSON {
* The valid properties for fontFamilies under settings key.
*
* @since 6.5.0
*
* @var array
*/
const FONT_FAMILY_SCHEMA = array(
@ -517,7 +515,6 @@ class WP_Theme_JSON {
* @since 6.3.0 Added support for `typography.textColumns`.
* @since 6.5.0 Added support for `dimensions.aspectRatio`.
* @since 6.6.0 Added `background` sub properties to top-level only.
*
* @var array
*/
const VALID_STYLES = array(
@ -591,6 +588,7 @@ class WP_Theme_JSON {
*
* @since 6.1.0
* @since 6.2.0 Added support for ':link' and ':any-link'.
* @var array
*/
const VALID_ELEMENT_PSEUDO_SELECTORS = array(
'link' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ),
@ -938,7 +936,6 @@ class WP_Theme_JSON {
* @return array The sanitized output.
*/
protected static function sanitize( $input, $valid_block_names, $valid_element_names, $valid_variations ) {
$output = array();
if ( ! is_array( $input ) ) {
@ -2311,7 +2308,7 @@ class WP_Theme_JSON {
* @param array $theme_json Theme JSON array.
* @param string $selector The style block selector.
* @param boolean $use_root_padding Whether to add custom properties at root level.
* @return array Returns the modified $declarations.
* @return array Returns the modified $declarations.
*/
protected static function compute_style_properties( $styles, $settings = array(), $properties = null, $theme_json = null, $selector = null, $use_root_padding = null ) {
if ( empty( $styles ) ) {
@ -2815,7 +2812,6 @@ class WP_Theme_JSON {
* Fixed custom CSS output in block style variations.
*
* @param array $block_metadata Metadata about the block to get styles for.
*
* @return string Styles for the block.
*/
public function get_styles_for_block( $block_metadata ) {
@ -3040,9 +3036,9 @@ class WP_Theme_JSON {
$use_root_padding = isset( $this->theme_json['settings']['useRootPaddingAwareAlignments'] ) && true === $this->theme_json['settings']['useRootPaddingAwareAlignments'];
/*
* If there are content and wide widths in theme.json, output them
* as custom properties on the body element so all blocks can use them.
*/
* If there are content and wide widths in theme.json, output them
* as custom properties on the body element so all blocks can use them.
*/
if ( isset( $settings['layout']['contentSize'] ) || isset( $settings['layout']['wideSize'] ) ) {
$content_size = isset( $settings['layout']['contentSize'] ) ? $settings['layout']['contentSize'] : $settings['layout']['wideSize'];
$content_size = static::is_safe_css_declaration( 'max-width', $content_size ) ? $content_size : 'initial';
@ -3053,13 +3049,13 @@ class WP_Theme_JSON {
}
/*
* Reset default browser margin on the body element.
* This is set on the body selector **before** generating the ruleset
* from the `theme.json`. This is to ensure that if the `theme.json` declares
* `margin` in its `spacing` declaration for the `body` element then these
* user-generated values take precedence in the CSS cascade.
* @link https://github.com/WordPress/gutenberg/issues/36147.
*/
* Reset default browser margin on the body element.
* This is set on the body selector **before** generating the ruleset
* from the `theme.json`. This is to ensure that if the `theme.json` declares
* `margin` in its `spacing` declaration for the `body` element then these
* user-generated values take precedence in the CSS cascade.
* @link https://github.com/WordPress/gutenberg/issues/36147.
*/
$css .= ':where(body) { margin: 0; }';
if ( $use_root_padding ) {
@ -3469,8 +3465,8 @@ class WP_Theme_JSON {
* @since 6.6.0 Updated to allow variation element styles and $origin parameter.
*
* @param array $theme_json Structure to sanitize.
* @param string $origin Optional. What source of data this object represents.
* One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'.
* @param string $origin Optional. What source of data this object represents.
* One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'.
* @return array Sanitized structure.
*/
public static function remove_insecure_properties( $theme_json, $origin = 'theme' ) {
@ -4202,6 +4198,7 @@ class WP_Theme_JSON {
* For example, `var:preset|color|vivid-green-cyan` becomes `var(--wp--preset--color--vivid-green-cyan)`.
*
* @since 6.3.0
*
* @param string $value The variable such as var:preset|color|vivid-green-cyan to convert.
* @return string The converted variable.
*/
@ -4227,7 +4224,8 @@ class WP_Theme_JSON {
* It is recursive and modifies the input in-place.
*
* @since 6.3.0
* @param array $tree Input to process.
*
* @param array $tree Input to process.
* @return array The modified $tree.
*/
private static function resolve_custom_css_format( $tree ) {
@ -4251,7 +4249,6 @@ class WP_Theme_JSON {
*
* @param object $block_type The block type.
* @param string $root_selector The block's root selector.
*
* @return array The custom selectors set by the block.
*/
protected static function get_block_selectors( $block_type, $root_selector ) {
@ -4310,9 +4307,8 @@ class WP_Theme_JSON {
*
* @param object $metadata The related block metadata containing selectors.
* @param object $node A merged theme.json node for block or variation.
*
* @return array The style declarations for the node's features with custom
* selectors.
* selectors.
*/
protected function get_feature_declarations_for_node( $metadata, &$node ) {
$declarations = array();
@ -4470,8 +4466,8 @@ class WP_Theme_JSON {
* Resolves the values of CSS variables in the given styles.
*
* @since 6.3.0
* @param WP_Theme_JSON $theme_json The theme json resolver.
*
* @param WP_Theme_JSON $theme_json The theme json resolver.
* @return WP_Theme_JSON The $theme_json with resolved variables.
*/
public static function resolve_variables( $theme_json ) {

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59326';
$wp_version = '6.8-alpha-59328';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.