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

Chore: Remove: Declarations parameter from compute_style_properties #31573

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: 4 additions & 4 deletions lib/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,12 @@ private static function has_properties( $metadata ) {
* )
* ```
*
* @param array $declarations Holds the existing declarations.
* @param array $styles Styles to process.
*
* @return array Returns the modified $declarations.
*/
private static function compute_style_properties( $declarations, $styles ) {
private static function compute_style_properties( $styles ) {
$declarations = array();
if ( empty( $styles ) ) {
return $declarations;
}
Expand Down Expand Up @@ -835,7 +835,7 @@ private function get_block_styles( $style_nodes, $setting_nodes ) {

$node = _wp_array_get( $this->theme_json, $metadata['path'], array() );
$selector = $metadata['selector'];
$declarations = self::compute_style_properties( array(), $node );
$declarations = self::compute_style_properties( $node );

$is_link_element = self::is_link_element( $metadata['selector'] );
if ( ! $is_link_element ) {
Expand Down Expand Up @@ -1220,7 +1220,7 @@ private static function remove_insecure_settings( $input ) {
*/
private static function remove_insecure_styles( $input, $selector ) {
$output = array();
$declarations = self::compute_style_properties( array(), $input );
$declarations = self::compute_style_properties( $input );
// To be removed once the user styles
// no longer use the --wp--style--color--link.
if ( self::is_link_element( $selector ) ) {
Expand Down