From 8c52123aead4c19be6c89468f67c2812504dddb0 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Mon, 18 Jul 2022 10:55:40 +0300 Subject: [PATCH] Make the Style Engine Store hookable --- .../class-wp-style-engine-css-rules-store.php | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/style-engine/class-wp-style-engine-css-rules-store.php b/packages/style-engine/class-wp-style-engine-css-rules-store.php index 1dc4da265accc7..cca8fa397ceb04 100644 --- a/packages/style-engine/class-wp-style-engine-css-rules-store.php +++ b/packages/style-engine/class-wp-style-engine-css-rules-store.php @@ -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. *