Make WordPress Core


Ignore:
Timestamp:
07/02/2021 06:59:57 PM (3 years ago)
Author:
desrosj
Message:

Docs: Add missing @since tags for some WP_Theme_JSON methods.

Docs: Update syntax for multi-line comments per the documentation standards.

Follow-up to [50959], [50967], [50973], [51051], [51089], [51149].

Props SergeyBiryukov.
Merges [51283] to the 5.8 branch.
See #52628, #53461.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/class-wp-theme-json.php

    r51241 r51314  
    397397            }
    398398
    399             // Assign defaults, then overwrite those that the block sets by itself.
    400             // If the block selector is compounded, will append the element to each
    401             // individual block selector.
     399            /*
     400             * Assign defaults, then overwrite those that the block sets by itself.
     401             * If the block selector is compounded, will append the element to each
     402             * individual block selector.
     403             */
    402404            $block_selectors = explode( ',', self::$blocks_metadata[ $block_name ]['selector'] );
    403405            foreach ( self::ELEMENTS as $el_name => $el_selector ) {
     
    643645     * "h1.some-class, h2.some-class, h3.some-class".
    644646     *
     647     * @since 5.8.0
     648     *
    645649     * @param string $selector Original selector.
    646650     * @param string $to_append Selector to append.
     
    662666     * it returns an array where each key is the preset slug and each value the preset value.
    663667     *
     668     * @since 5.8.0
     669     *
    664670     * @param array  $preset_per_origin Array of presets keyed by origin.
    665671     * @param string $value_key         The property of the preset that contains its value.
     
    674680            }
    675681            foreach ( $preset_per_origin[ $origin ] as $preset ) {
    676                 // We don't want to use kebabCase here,
    677                 // see https://github.com/WordPress/gutenberg/issues/32347
    678                 // However, we need to make sure the generated class or css variable
    679                 // doesn't contain spaces.
     682                /*
     683                 * We don't want to use kebabCase here,
     684                 * see https://github.com/WordPress/gutenberg/issues/32347
     685                 * However, we need to make sure the generated class or CSS variable
     686                 * doesn't contain spaces.
     687                 */
    680688                $result[ preg_replace( '/\s+/', '-', $preset['slug'] ) ] = $preset[ $value_key ];
    681689            }
     
    869877        $properties = array();
    870878        foreach ( self::PROPERTIES_METADATA as $name => $metadata ) {
    871             // Some properties can be shorthand properties, meaning that
    872             // they contain multiple values instead of a single one.
    873             // An example of this is the padding property.
     879            /*
     880             * Some properties can be shorthand properties, meaning that
     881             * they contain multiple values instead of a single one.
     882             * An example of this is the padding property.
     883             */
    874884            if ( self::has_properties( $metadata ) ) {
    875885                foreach ( $metadata['properties'] as $property ) {
     
    10831093    /**
    10841094     * Merge new incoming data.
     1095     *
     1096     * @since 5.8.0
    10851097     *
    10861098     * @param WP_Theme_JSON $incoming Data to merge.
Note: See TracChangeset for help on using the changeset viewer.