# elementor/4.3.0-beta3/modules/default-styles/atomic-default-styles.php

Elementor Website Builder – more than just a page builder, version 4.3.0-beta3. 62 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.3.0-beta3/code/modules/default-styles/atomic-default-styles.php
- Raw: https://pluginprobe.com/plugins/elementor/4.3.0-beta3/raw/modules/default-styles/atomic-default-styles.php
- Modified: 2026-09-01T11:47:36+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/4.3.0-beta3/code/modules/default-styles/atomic-default-styles.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\DefaultStyles;

use Elementor\Modules\AtomicWidgets\Styles\Atomic_Styles_Manager;
use Elementor\Plugin;

class Atomic_Default_Styles {
	const STYLES_KEY = 'default';

	public function register_hooks() {
		add_action(
			'elementor/atomic-widgets/styles/register',
			fn( Atomic_Styles_Manager $styles_manager ) => $this->register_styles( $styles_manager ),
			15,
			1
		);

		add_action(
			'elementor/default_styles/update',
			fn() => $this->invalidate_cache(),
			10,
			0
		);

		add_action(
			'elementor/core/files/clear_cache',
			fn() => $this->invalidate_cache(),
		);

		add_action(
			'deleted_post',
			fn( $post_id ) => $this->on_kit_delete( $post_id ),
		);
	}

	private function register_styles( Atomic_Styles_Manager $styles_manager ) {
		$styles_manager->register(
			[ self::STYLES_KEY ],
			fn () => $this->get_all_default_styles(),
		);
	}

	private function get_all_default_styles(): array {
		$items = Default_Styles_Repository::make()->all();

		return array_values( $items );
	}

	private function invalidate_cache(): void {
		do_action( 'elementor/atomic-widgets/styles/clear', [ self::STYLES_KEY ] );
	}

	private function on_kit_delete( $post_id ): void {
		if ( ! Plugin::$instance->kits_manager->is_kit( $post_id ) ) {
			return;
		}

		$this->invalidate_cache();
	}
}

```
