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].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51283


git-svn-id: http://core.svn.wordpress.org/trunk@50892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-06-30 16:23:57 +00:00
parent b10b4a2586
commit 40ff2751bc
2 changed files with 23 additions and 11 deletions

View File

@ -396,9 +396,11 @@ class WP_Theme_JSON {
self::$blocks_metadata[ $block_name ]['selector'] = '.wp-block-' . str_replace( '/', '-', str_replace( 'core/', '', $block_name ) ); self::$blocks_metadata[ $block_name ]['selector'] = '.wp-block-' . str_replace( '/', '-', str_replace( 'core/', '', $block_name ) );
} }
// Assign defaults, then overwrite those that the block sets by itself. /*
// If the block selector is compounded, will append the element to each * Assign defaults, then overwrite those that the block sets by itself.
// individual block selector. * If the block selector is compounded, will append the element to each
* individual block selector.
*/
$block_selectors = explode( ',', self::$blocks_metadata[ $block_name ]['selector'] ); $block_selectors = explode( ',', self::$blocks_metadata[ $block_name ]['selector'] );
foreach ( self::ELEMENTS as $el_name => $el_selector ) { foreach ( self::ELEMENTS as $el_name => $el_selector ) {
$element_selector = array(); $element_selector = array();
@ -642,6 +644,8 @@ class WP_Theme_JSON {
* and the $to_append selector ".some-class" the result will be * and the $to_append selector ".some-class" the result will be
* "h1.some-class, h2.some-class, h3.some-class". * "h1.some-class, h2.some-class, h3.some-class".
* *
* @since 5.8.0
*
* @param string $selector Original selector. * @param string $selector Original selector.
* @param string $to_append Selector to append. * @param string $to_append Selector to append.
* *
@ -661,6 +665,8 @@ class WP_Theme_JSON {
* Given an array of presets keyed by origin and the value key of the preset, * Given an array of presets keyed by origin and the value key of the preset,
* it returns an array where each key is the preset slug and each value the preset value. * it returns an array where each key is the preset slug and each value the preset value.
* *
* @since 5.8.0
*
* @param array $preset_per_origin Array of presets keyed by origin. * @param array $preset_per_origin Array of presets keyed by origin.
* @param string $value_key The property of the preset that contains its value. * @param string $value_key The property of the preset that contains its value.
* *
@ -673,10 +679,12 @@ class WP_Theme_JSON {
continue; continue;
} }
foreach ( $preset_per_origin[ $origin ] as $preset ) { foreach ( $preset_per_origin[ $origin ] as $preset ) {
// We don't want to use kebabCase here, /*
// see https://github.com/WordPress/gutenberg/issues/32347 * We don't want to use kebabCase here,
// However, we need to make sure the generated class or css variable * see https://github.com/WordPress/gutenberg/issues/32347
// doesn't contain spaces. * However, we need to make sure the generated class or CSS variable
* doesn't contain spaces.
*/
$result[ preg_replace( '/\s+/', '-', $preset['slug'] ) ] = $preset[ $value_key ]; $result[ preg_replace( '/\s+/', '-', $preset['slug'] ) ] = $preset[ $value_key ];
} }
} }
@ -868,9 +876,11 @@ class WP_Theme_JSON {
$properties = array(); $properties = array();
foreach ( self::PROPERTIES_METADATA as $name => $metadata ) { foreach ( self::PROPERTIES_METADATA as $name => $metadata ) {
// Some properties can be shorthand properties, meaning that /*
// they contain multiple values instead of a single one. * Some properties can be shorthand properties, meaning that
// An example of this is the padding property. * they contain multiple values instead of a single one.
* An example of this is the padding property.
*/
if ( self::has_properties( $metadata ) ) { if ( self::has_properties( $metadata ) ) {
foreach ( $metadata['properties'] as $property ) { foreach ( $metadata['properties'] as $property ) {
$properties[] = array( $properties[] = array(
@ -1083,6 +1093,8 @@ class WP_Theme_JSON {
/** /**
* Merge new incoming data. * Merge new incoming data.
* *
* @since 5.8.0
*
* @param WP_Theme_JSON $incoming Data to merge. * @param WP_Theme_JSON $incoming Data to merge.
*/ */
public function merge( $incoming ) { public function merge( $incoming ) {

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.9-alpha-51282'; $wp_version = '5.9-alpha-51283';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.