Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add @SInCE notes.
  • Loading branch information
tellthemachines committed May 2, 2024
commit 1ee6018eab0ec23b09f320d60f57b0fc9c58e478
1 change: 1 addition & 0 deletions src/wp-includes/style-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function wp_style_engine_get_styles( $block_styles, $options = array() ) {
* .elephant-are-cool{color:gray;width:3em}
*
* @since 6.1.0
* @since 6.6.0 Added support for `$rules_group` in the `$css_rules` array.
*
* @param array $css_rules {
* Required. A collection of CSS rules.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class WP_Style_Engine_CSS_Rule {
* A parent CSS selector in the case of nested CSS, or a CSS nested @rule,
* such as `@media (min-width: 80rem)` or `@layer module`.
*
* @since 6.6.0
* @var string
*/
protected $rules_group;
Expand All @@ -47,6 +48,7 @@ class WP_Style_Engine_CSS_Rule {
* Constructor.
*
* @since 6.1.0
* @since 6.6.0 Added the `$rules_group` parameter.
*
* @param string $selector Optional. The CSS selector. Default empty string.
* @param string[]|WP_Style_Engine_CSS_Declarations $declarations Optional. An associative array of CSS definitions,
Expand Down Expand Up @@ -103,6 +105,8 @@ public function add_declarations( $declarations ) {
/**
* Sets the rules group.
*
* @since 6.6.0
*
* @param string $rules_group A parent CSS selector in the case of nested CSS, or a CSS nested @rule,
* such as `@media (min-width: 80rem)` or `@layer module`.
*
Expand All @@ -116,6 +120,8 @@ public function set_rules_group( $rules_group ) {
/**
* Gets the rules group.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should new methods and updates to other public methods/APIs get a @since annotation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good point, yeah they should!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated ✅

* @since 6.6.0
*
* @return string
*/
public function get_rules_group() {
Expand Down Expand Up @@ -148,6 +154,7 @@ public function get_selector() {
* Gets the CSS.
*
* @since 6.1.0
* @since 6.6.0 Added support for nested CSS with rules groups.
*
* @param bool $should_prettify Optional. Whether to add spacing, new lines and indents.
* Default false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public function get_all_rules() {
* If the rule does not exist, it will be created.
*
* @since 6.1.0
* @since 6.6.0 Added the $rules_group parameter.
*
* @param string $selector The CSS selector.
* @param string $rules_group A parent CSS selector in the case of nested CSS, or a CSS nested @rule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function add_store( $store ) {
* Adds rules to be processed.
*
* @since 6.1.0
* @since 6.6.0 Added support for rules_group.
*
* @param WP_Style_Engine_CSS_Rule|WP_Style_Engine_CSS_Rule[] $css_rules A single, or an array of,
* WP_Style_Engine_CSS_Rule objects
Expand Down
1 change: 1 addition & 0 deletions src/wp-includes/style-engine/class-wp-style-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ protected static function is_valid_style_value( $style_value ) {
* Stores a CSS rule using the provided CSS selector and CSS declarations.
*
* @since 6.1.0
* @since 6.6.0 Added the `$rules_group` parameter.
*
* @param string $store_name A valid store key.
* @param string $css_selector When a selector is passed, the function will return
Expand Down