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

Revert "Add check to avoid PHP warnings" #30174

Merged
merged 1 commit into from
Mar 24, 2021
Merged
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
8 changes: 1 addition & 7 deletions lib/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ private static function compute_style_properties( $declarations, $styles ) {
foreach ( $properties as $prop ) {
$value = self::get_property_value( $styles, $prop['value'] );
if ( ! empty( $value ) ) {
$declarations[] = array(
$declarations[] = array(
'name' => $prop['name'],
'value' => $value,
);
Expand Down Expand Up @@ -678,9 +678,6 @@ private static function compute_preset_classes( $settings, $selector ) {
$stylesheet = '';
foreach ( self::PRESETS_METADATA as $preset ) {
$values = _wp_array_get( $settings, $preset['path'], array() );
if ( empty( $values ) ) {
continue;
}
foreach ( $values as $value ) {
foreach ( $preset['classes'] as $class ) {
$stylesheet .= self::to_ruleset(
Expand Down Expand Up @@ -719,9 +716,6 @@ private static function compute_preset_classes( $settings, $selector ) {
private static function compute_preset_vars( $declarations, $settings ) {
foreach ( self::PRESETS_METADATA as $preset ) {
$values = _wp_array_get( $settings, $preset['path'], array() );
if ( empty( $values ) ) {
continue;
}
foreach ( $values as $value ) {
$declarations[] = array(
'name' => '--wp--preset--' . $preset['css_var_infix'] . '--' . $value['slug'],
Expand Down