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

Global Styles: enqueue preset classes in the front-end #28792

Merged
merged 2 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ private function get_block_styles() {

$metadata = $this->get_blocks_metadata();
foreach ( $metadata as $block_selector => $metadata ) {
if ( empty( $metadata['selector'] ) || empty( $metadata['supports'] ) ) {
if ( empty( $metadata['selector'] ) ) {
continue;
}

Expand Down
7 changes: 4 additions & 3 deletions phpunit/class-wp-theme-json-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,13 @@ function test_get_settings() {
}

function test_get_stylesheet() {
$root_name = WP_Theme_JSON::ROOT_BLOCK_NAME;
// See schema at WP_Theme_JSON::SCHEMA.
$root_name = WP_Theme_JSON::ROOT_BLOCK_NAME;
$all_blocks_name = WP_Theme_JSON::ALL_BLOCKS_NAME;

$theme_json = new WP_Theme_JSON(
array(
'settings' => array(
$root_name => array(
$all_blocks_name => array(
'color' => array(
'text' => 'value',
'palette' => array(
Expand Down