# elementor/3.30.0/modules/atomic-widgets/utils.php

Elementor Website Builder – more than just a page builder, version 3.30.0. 32 lines.

- Page: https://pluginprobe.com/plugins/elementor/3.30.0/code/modules/atomic-widgets/utils.php
- Raw: https://pluginprobe.com/plugins/elementor/3.30.0/raw/modules/atomic-widgets/utils.php
- Modified: 2025-04-28T07:15:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/3.30.0/code/modules/atomic-widgets/utils.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\AtomicWidgets;

use Elementor\Modules\AtomicWidgets\Elements\Atomic_Element_Base;
use Elementor\Modules\AtomicWidgets\Elements\Atomic_Widget_Base;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Utils {
	public static function is_atomic( $element_instance ): bool {
		return $element_instance instanceof Atomic_Element_Base ||
			$element_instance instanceof Atomic_Widget_Base;
	}

	public static function generate_id( string $prefix = '', $existing_ids = [] ): string {
		do {
			$generated = substr(
				bin2hex( random_bytes( 4 ) ),
				0,
				7
			);

			$id = "$prefix{$generated}";
		} while ( in_array( $id, $existing_ids, true ) );

		return $id;
	}
}

```
