Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style-Engine: Make the Style Engine Store hookable #42493

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
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
21 changes: 20 additions & 1 deletion packages/style-engine/class-wp-style-engine-css-rules-store.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,27 @@ public static function get_store( $store_name = 'default' ) {
if ( ! isset( static::$stores[ $store_name ] ) ) {
static::$stores[ $store_name ] = new static();
}
return static::$stores[ $store_name ];

$store = static::$stores[ $store_name ];

/**
* Filters the CSS Rules Store.
*
* @param WP_Style_Engine_CSS_Rules_Store $store The CSS Rules Store.
* @param string $store_name The name of the store.
*/
return apply_filters( 'wp_style_engine_css_rules_store', $store, $store_name );
}

/**
* Get an array of all available stores.
*
* @return WP_Style_Engine_CSS_Rules_Store[]
*/
public static function get_stores() {
return static::$stores;
}

/**
* Get an array of all rules.
*
Expand Down