Skip to content

Commit

Permalink
Make get_blocks_metadata() call static
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath authored Feb 11, 2021
1 parent db628e4 commit f983876
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public function __construct( $theme_json = array() ) {
// Remove top-level keys that aren't present in the schema.
$this->theme_json = array_intersect_key( $theme_json, self::SCHEMA );

$block_metadata = $this->get_blocks_metadata();
$block_metadata = self::get_blocks_metadata();
foreach ( array( 'settings', 'styles' ) as $subtree ) {
// Remove settings & styles subtrees if they aren't arrays.
if ( isset( $this->theme_json[ $subtree ] ) && ! is_array( $this->theme_json[ $subtree ] ) ) {
Expand Down Expand Up @@ -934,7 +934,7 @@ private function get_css_variables() {
return $stylesheet;
}

$metadata = $this->get_blocks_metadata();
$metadata = self::get_blocks_metadata();
foreach ( $this->theme_json['settings'] as $block_selector => $settings ) {
if ( empty( $metadata[ $block_selector ]['selector'] ) ) {
continue;
Expand Down Expand Up @@ -994,7 +994,7 @@ private function get_block_styles() {
return $stylesheet;
}

$metadata = $this->get_blocks_metadata();
$metadata = self::get_blocks_metadata();
foreach ( $metadata as $block_selector => $metadata ) {
if ( empty( $metadata['selector'] ) ) {
continue;
Expand Down

0 comments on commit f983876

Please sign in to comment.