Make WordPress Core

Changeset 59328 for trunk


Ignore:
Timestamp:
10/30/2024 11:50:03 PM (22 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r59262 r59328  
    228228         * @since 6.6.0 Added `background-[image|position|repeat|size]` properties.
    229229         * @since 6.7.0 Added `background-attachment` property.
    230          *
    231230         * @var array
    232231         */
     
    308307         * @since 6.2.0
    309308         * @since 6.6.0 Added background-image properties.
    310          *
    311309         * @var array
    312310         */
     
    340338         *
    341339         * @since 5.9.0
     340         * @var array
    342341         */
    343342        const PROTECTED_PROPERTIES = array(
     
    476475         *
    477476         * @since 6.5.0
    478          *
    479477         * @var array
    480478         */
     
    518516         * @since 6.5.0 Added support for `dimensions.aspectRatio`.
    519517         * @since 6.6.0 Added `background` sub properties to top-level only.
    520          *
    521518         * @var array
    522519         */
     
    592589         * @since 6.1.0
    593590         * @since 6.2.0 Added support for ':link' and ':any-link'.
     591         * @var array
    594592         */
    595593        const VALID_ELEMENT_PSEUDO_SELECTORS = array(
     
    939937         */
    940938        protected static function sanitize( $input, $valid_block_names, $valid_element_names, $valid_variations ) {
    941 
    942939                $output = array();
    943940
     
    23122309         * @param string  $selector The style block selector.
    23132310         * @param boolean $use_root_padding Whether to add custom properties at root level.
    2314          * @return array  Returns the modified $declarations.
     2311         * @return array Returns the modified $declarations.
    23152312         */
    23162313        protected static function compute_style_properties( $styles, $settings = array(), $properties = null, $theme_json = null, $selector = null, $use_root_padding = null ) {
     
    28162813         *
    28172814         * @param array $block_metadata Metadata about the block to get styles for.
    2818          *
    28192815         * @return string Styles for the block.
    28202816         */
     
    30413037
    30423038                /*
    3043                 * If there are content and wide widths in theme.json, output them
    3044                 * 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                 */
    30463042                if ( isset( $settings['layout']['contentSize'] ) || isset( $settings['layout']['wideSize'] ) ) {
    30473043                        $content_size = isset( $settings['layout']['contentSize'] ) ? $settings['layout']['contentSize'] : $settings['layout']['wideSize'];
     
    30543050
    30553051                /*
    3056                 * Reset default browser margin on the body element.
    3057                 * This is set on the body selector **before** generating the ruleset
    3058                 * from the `theme.json`. This is to ensure that if the `theme.json` declares
    3059                 * `margin` in its `spacing` declaration for the `body` element then these
    3060                 * 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                 */
    30633059                $css .= ':where(body) { margin: 0; }';
    30643060
     
    34703466         *
    34713467         * @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'.
    34743470         * @return array Sanitized structure.
    34753471         */
     
    42034199         *
    42044200         * @since 6.3.0
     4201         *
    42054202         * @param string $value The variable such as var:preset|color|vivid-green-cyan to convert.
    42064203         * @return string The converted variable.
     
    42284225         *
    42294226         * @since 6.3.0
    4230          * @param array $tree   Input to process.
     4227         *
     4228         * @param array $tree Input to process.
    42314229         * @return array The modified $tree.
    42324230         */
     
    42524250         * @param object $block_type    The block type.
    42534251         * @param string $root_selector The block's root selector.
    4254          *
    42554252         * @return array The custom selectors set by the block.
    42564253         */
     
    43114308         * @param object $metadata The related block metadata containing selectors.
    43124309         * @param object $node     A merged theme.json node for block or variation.
    4313          *
    43144310         * @return array The style declarations for the node's features with custom
    4315          * selectors.
     4311         *               selectors.
    43164312         */
    43174313        protected function get_feature_declarations_for_node( $metadata, &$node ) {
     
    44714467         *
    44724468         * @since 6.3.0
     4469         *
    44734470         * @param WP_Theme_JSON $theme_json The theme json resolver.
    4474          *
    44754471         * @return WP_Theme_JSON The $theme_json with resolved variables.
    44764472         */
Note: See TracChangeset for help on using the changeset viewer.