Skip to content

Commit

Permalink
Add a $rules_store param in the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Mar 17, 2023
1 parent f3a69db commit a1aceab
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,16 +595,17 @@ public static function get_element_class_name( $element ) {
*
* @since 5.8.0
*
* @param array $theme_json A structure that follows the theme.json schema.
* @param string $origin Optional. What source of data this object represents.
* One of 'default', 'theme', or 'custom'. Default 'theme'.
* @param array $theme_json A structure that follows the theme.json schema.
* @param string $origin Optional. What source of data this object represents.
* One of 'default', 'theme', or 'custom'. Default 'theme'.
* @param string $rules_store Optional. The name of the CSS rules-store to use.
*/
public function __construct( $theme_json = array(), $origin = 'theme' ) {
public function __construct( $theme_json = array(), $origin = 'theme', $rules_store = 'global-styles' ) {
if ( ! in_array( $origin, static::VALID_ORIGINS, true ) ) {
$origin = 'theme';
}

$this->rules_store = WP_Style_Engine_CSS_Rules_Store::get_store( 'global-styles' );
$this->rules_store = WP_Style_Engine_CSS_Rules_Store::get_store( $rules_store );
$this->theme_json = WP_Theme_JSON_Schema::migrate( $theme_json );
$registry = WP_Block_Type_Registry::get_instance();
$valid_block_names = array_keys( $registry->get_all_registered() );
Expand Down

0 comments on commit a1aceab

Please sign in to comment.