mirror of
https://github.com/proelements/proelements.git
synced 2026-05-05 09:05:59 +00:00
v4.0.4.1
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\AtomicWidgets;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Settings_Resolver {
|
||||
public static function resolve( array $settings ): array {
|
||||
$resolved = [];
|
||||
|
||||
foreach ( $settings as $key => $value ) {
|
||||
$resolved[ $key ] = static::resolve_value( $value );
|
||||
}
|
||||
|
||||
return $resolved;
|
||||
}
|
||||
|
||||
private static function resolve_value( $value ) {
|
||||
if ( ! is_array( $value ) ) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if ( ! empty( $value['$$type'] ) && array_key_exists( 'value', $value ) ) {
|
||||
return static::resolve_value( $value['value'] );
|
||||
}
|
||||
|
||||
return array_map( [ static::class, 'resolve_value' ], $value );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user