| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Mcp\Abilities\Utils; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
class Default_Children_Utils { |
| 10 |
public static function get_required_child_types( array $default_children ): array { |
| 11 |
$types = []; |
| 12 |
|
| 13 |
foreach ( $default_children as $child ) { |
| 14 |
if ( empty( $child['meta']['required'] ) ) { |
| 15 |
continue; |
| 16 |
} |
| 17 |
|
| 18 |
$type = $child['widgetType'] ?? $child['elType'] ?? null; |
| 19 |
|
| 20 |
if ( $type ) { |
| 21 |
$types[] = $type; |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
return $types; |
| 26 |
} |
| 27 |
} |
| 28 |
|