Skip to content

Commit

Permalink
Remove unecessary dev mode check for cache
Browse files Browse the repository at this point in the history
  • Loading branch information
pereirinha committed Jan 4, 2024
1 parent bd6f08c commit 2377348
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -1934,13 +1934,11 @@ protected static function compute_style_properties( $styles, $settings = array()
return $declarations;
}

$can_use_cached = ! wp_is_development_mode( 'theme' );

$args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.Changed
$cache_key = 'compute_style_properties_' . md5( wp_json_encode( $args ) );
$cache = wp_cache_get( $cache_key, 'wp-styles' );

if ( $can_use_cached && $cache ) {
if ( $cache ) {
return $cache;
}

Expand Down Expand Up @@ -2010,9 +2008,7 @@ protected static function compute_style_properties( $styles, $settings = array()
}
}

if ( $can_use_cached ) {
wp_cache_set( $cache_key, $declarations, 'wp-styles', DAY_IN_SECONDS );
}
wp_cache_set( $cache_key, $declarations, 'wp-styles', DAY_IN_SECONDS );

return $declarations;
}
Expand Down

0 comments on commit 2377348

Please sign in to comment.